Improved efficiency with staff and orb effects.

This commit is contained in:
allstar69 2013-07-20 14:03:16 -07:00
commit d1a51bb691
13 changed files with 298 additions and 99 deletions

View file

@ -5,21 +5,41 @@ import MysticWorld.Blocks.BlockHandler;
import MysticWorld.Entity.EntityChargeAir;
import net.minecraft.block.Block;
import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.potion.Potion;
import net.minecraft.potion.PotionEffect;
import net.minecraft.world.World;
public class ItemOrbEnergy extends Item {
public class ItemOrbEnergy extends ItemOrb {
public ItemOrbEnergy(int par1)
public ItemOrbEnergy(int id)
{
super(par1);
this.setMaxStackSize(1);
this.setMaxDamage(200);
this.setCreativeTab(MysticWorld.MysticWorldTab);
super(id);
}
@Override
public void onUpdate(ItemStack itemStack, World world, Entity entity, int par4, boolean par5)
{
EntityPlayer player = (EntityPlayer)entity;
ItemStack currentItem = player.inventory.getCurrentItem();
if (!world.isRemote)
{
if (currentItem != null)
{
if (currentItem.itemID == itemStack.itemID)
{
player.addPotionEffect(new PotionEffect(Potion.moveSpeed.getId(), 20, 2));
MysticWorld.proxy.energyFX(world, (player.posX - 0.5D) + rand.nextDouble(), player.posY, (player.posZ - 0.5D) + rand.nextDouble(), 1.0F);
}
}
}
}
@Override
public boolean onItemUse(ItemStack itemStack, EntityPlayer entityPlayer, World world, int par4, int par5, int par6, int par7, float par8, float par9, float par10)
{
if (par7 == 0)
@ -70,11 +90,5 @@ public class ItemOrbEnergy extends Item {
return true;
}
}
@Override
public void registerIcons(IconRegister iconRegister)
{
itemIcon = iconRegister.registerIcon("MysticTextures:OrbEnergy");
}
}