mirror of
https://github.com/GTNewHorizons/BloodArsenal.git
synced 2026-11-24 22:14:36 +00:00
Merge pull request #26 from Namikon/patch-1
Update BloodArsenalEventHooks.java
This commit is contained in:
commit
2afb5d21ed
1 file changed
+15
-9
@@ -73,19 +73,25 @@ public class BloodArsenalEventHooks
|
||||
}
|
||||
}
|
||||
|
||||
EntityPlayerMP player = (EntityPlayerMP) entityAttacked;
|
||||
|
||||
if (player.inventory.armorInventory != null)
|
||||
// ThaumicTinkerer extends Thaumcraft's Fakeplayer, which extends EntityPlayer instead
|
||||
// of Forge's FakePlayer class. That's why the Tinkerer's table crashes here.
|
||||
// With this sanity check any crashes related to that problem should be gone
|
||||
if (entityAttacked instanceof EntityPlayerMP)
|
||||
{
|
||||
for (int i = 0; i < 4; i++)
|
||||
EntityPlayerMP player = (EntityPlayerMP) entityAttacked;
|
||||
|
||||
if (player.inventory.armorInventory != null)
|
||||
{
|
||||
ItemStack armorStack = player.inventory.armorInventory[3 - i];
|
||||
|
||||
if (armorStack != null && armorStack.getItem() instanceof GlassArmor)
|
||||
for (int i = 0; i < 4; i++)
|
||||
{
|
||||
if (entityAttacking instanceof EntityLivingBase)
|
||||
ItemStack armorStack = player.inventory.armorInventory[3 - i];
|
||||
|
||||
if (armorStack != null && armorStack.getItem() instanceof GlassArmor)
|
||||
{
|
||||
((EntityLivingBase) entityAttacking).addPotionEffect(new PotionEffect(BloodArsenalConfig.bleedingID, rand.nextInt(3) * 20, rand.nextInt(1)));
|
||||
if (entityAttacking instanceof EntityLivingBase)
|
||||
{
|
||||
((EntityLivingBase) entityAttacking).addPotionEffect(new PotionEffect(BloodArsenalConfig.bleedingID, rand.nextInt(3) * 20, rand.nextInt(1)));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user