From 70b72eef8b7e733cf5d01d057d222f5633a8832f Mon Sep 17 00:00:00 2001 From: Roger Schoellgen Date: Sat, 22 Jun 2013 09:37:03 -0700 Subject: [PATCH] Fire Orb activates fire resistance on player if they are burning and has the orb in their inventory --- common/MysticWorld/TickHandler.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/common/MysticWorld/TickHandler.java b/common/MysticWorld/TickHandler.java index 55feb4d..b588fc4 100644 --- a/common/MysticWorld/TickHandler.java +++ b/common/MysticWorld/TickHandler.java @@ -9,6 +9,7 @@ import MysticWorld.Items.ItemHandler$1; import net.minecraft.block.material.Material; import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.entity.projectile.EntityPotion; import net.minecraft.item.ItemStack; import net.minecraft.potion.Potion; @@ -35,6 +36,12 @@ public class TickHandler implements IScheduledTickHandler public void tickEnd(EnumSet type, Object... tickData){ EntityPlayer player = (EntityPlayer)tickData[0]; World world = player.worldObj; + InventoryPlayer inventory = player.inventory; + + if (inventory.hasItem(ItemHandler$1.fireOrb.itemID)){ + if (player.isBurning()) + player.addPotionEffect(new PotionEffect(Potion.fireResistance.getId(), 20, 0)); + } } public EnumSet ticks(){