Fixed NPE when attacking mobs when you don't have a set of Living Armour. Oops. Fixes #934
This commit is contained in:
parent
006cbeaa83
commit
7a42968633
|
@ -1,3 +1,8 @@
|
||||||
|
------------------------------------------------------
|
||||||
|
Version 2.1.0-65
|
||||||
|
------------------------------------------------------
|
||||||
|
- Fixed NPE when attacking mobs when you don't have a set of Living Armour. Oops.
|
||||||
|
|
||||||
------------------------------------------------------
|
------------------------------------------------------
|
||||||
Version 2.1.0-64
|
Version 2.1.0-64
|
||||||
------------------------------------------------------
|
------------------------------------------------------
|
||||||
|
|
|
@ -155,10 +155,19 @@ public class GenericHandler
|
||||||
ItemHelper.LPContainer.addLPToItem(player.getItemStackFromSlot(EntityEquipmentSlot.CHEST), totalLP, pack.CAPACITY);
|
ItemHelper.LPContainer.addLPToItem(player.getItemStackFromSlot(EntityEquipmentSlot.CHEST), totalLP, pack.CAPACITY);
|
||||||
}
|
}
|
||||||
|
|
||||||
LivingArmourUpgrade upgrade = ItemLivingArmour.getUpgrade(Constants.Mod.MODID + ".upgrade.battleHunger", player.getItemStackFromSlot(EntityEquipmentSlot.CHEST));
|
if (LivingArmour.hasFullSet(player))
|
||||||
if (upgrade instanceof LivingArmourUpgradeBattleHungry)
|
|
||||||
{
|
{
|
||||||
((LivingArmourUpgradeBattleHungry) upgrade).resetTimer();
|
ItemStack chestStack = player.getItemStackFromSlot(EntityEquipmentSlot.CHEST);
|
||||||
|
LivingArmour armour = ItemLivingArmour.getLivingArmour(chestStack);
|
||||||
|
if (armour != null)
|
||||||
|
{
|
||||||
|
|
||||||
|
LivingArmourUpgrade upgrade = ItemLivingArmour.getUpgrade(Constants.Mod.MODID + ".upgrade.battleHunger", chestStack);
|
||||||
|
if (upgrade instanceof LivingArmourUpgradeBattleHungry)
|
||||||
|
{
|
||||||
|
((LivingArmourUpgradeBattleHungry) upgrade).resetTimer();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue