From 9f6f9db5c6fe4c55bf9e7d3354cb360f818284d7 Mon Sep 17 00:00:00 2001 From: Adubbz Date: Mon, 22 Jul 2013 06:07:51 +1000 Subject: [PATCH] Added check that entities entering poison ivy only get poisoned if an instance of EntityLivingBase --- .../biomesoplenty/blocks/BlockBOPFoliage.java | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/src/minecraft/biomesoplenty/blocks/BlockBOPFoliage.java b/src/minecraft/biomesoplenty/blocks/BlockBOPFoliage.java index a4b6fad8a..c463554e7 100644 --- a/src/minecraft/biomesoplenty/blocks/BlockBOPFoliage.java +++ b/src/minecraft/biomesoplenty/blocks/BlockBOPFoliage.java @@ -189,19 +189,22 @@ public class BlockBOPFoliage extends BlockFlower implements IShearable if (!par1World.isRemote && meta == 7) { - if (par5Entity instanceof EntityPlayer) + if (par5Entity instanceof EntityLivingBase) { - InventoryPlayer inventory = ((EntityPlayer)par5Entity).inventory; - - if (!((inventory.armorInventory[0] != null && inventory.armorInventory[0].itemID == Item.bootsLeather.itemID) && (inventory.armorInventory[1] != null && inventory.armorInventory[1].itemID == Item.legsLeather.itemID))) + if (par5Entity instanceof EntityPlayer) + { + InventoryPlayer inventory = ((EntityPlayer)par5Entity).inventory; + + if (!((inventory.armorInventory[0] != null && inventory.armorInventory[0].itemID == Item.bootsLeather.itemID) && (inventory.armorInventory[1] != null && inventory.armorInventory[1].itemID == Item.legsLeather.itemID))) + { + ((EntityLivingBase)par5Entity).addPotionEffect(new PotionEffect(Potion.poison.id, 100)); + } + } + else { ((EntityLivingBase)par5Entity).addPotionEffect(new PotionEffect(Potion.poison.id, 100)); } } - else - { - ((EntityLivingBase)par5Entity).addPotionEffect(new PotionEffect(Potion.poison.id, 100)); - } } }