Added check that entities entering poison ivy only get poisoned if an instance of EntityLivingBase
This commit is contained in:
parent
922d8b837f
commit
9f6f9db5c6
1 changed files with 11 additions and 8 deletions
|
@ -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));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue