Added check that entities entering poison ivy only get poisoned if an instance of EntityLivingBase

This commit is contained in:
Adubbz 2013-07-22 06:07:51 +10:00
parent 922d8b837f
commit 9f6f9db5c6

View file

@ -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));
}
}
}