Changed orbs to have effects when held.

This commit is contained in:
allstar69 2013-06-28 17:52:28 -07:00
commit a01bdcebbf

View file

@ -33,14 +33,16 @@ public class TickHandler implements IScheduledTickHandler
EntityPlayer player = (EntityPlayer)tickData[0]; EntityPlayer player = (EntityPlayer)tickData[0];
World world = player.worldObj; World world = player.worldObj;
InventoryPlayer inventory = player.inventory; InventoryPlayer inventory = player.inventory;
ItemStack itemstack = inventory.getCurrentItem();
if (inventory.hasItem(ItemHandler$1.fireOrb.itemID) && player.isBurning()){ if (itemstack != null && itemstack.itemID == ItemHandler$1.fireOrb.itemID && player.isBurning()){
player.addPotionEffect(new PotionEffect(Potion.fireResistance.getId(), 20, 0)); player.addPotionEffect(new PotionEffect(Potion.fireResistance.getId(), 20, 0));
} }
if (inventory.hasItem(ItemHandler$1.airOrb.itemID) && player.getHeldItem() == new ItemStack(ItemHandler$1.airOrb)){ if (itemstack != null && itemstack.itemID == ItemHandler$1.airOrb.itemID){
player.fallDistance = 0.0F; player.fallDistance = 0.0F;
} }
} }
public void tickEnd(EnumSet<TickType> type, Object... tickData){ public void tickEnd(EnumSet<TickType> type, Object... tickData){