Fix unblockable damage being blocked by armor. (#3933) (#4106)

This commit is contained in:
talandar 2017-07-03 15:56:23 -04:00 committed by mezz
parent c1ae2cdbf2
commit 03b7885aa6
1 changed files with 6 additions and 1 deletions

View File

@ -118,6 +118,11 @@ public interface ISpecialArmor
*/
public static float applyArmor(EntityLivingBase entity, NonNullList<ItemStack> inventory, DamageSource source, double damage)
{
if (source.isUnblockable())
{
return (float)damage;
}
if (DEBUG)
{
System.out.println("Start: " + damage);
@ -144,7 +149,7 @@ public interface ISpecialArmor
totalArmor += prop.Armor;
totalToughness += prop.Toughness;
}
else if (stack.getItem() instanceof ItemArmor && !source.isUnblockable())
else if (stack.getItem() instanceof ItemArmor)
{
ItemArmor armor = (ItemArmor)stack.getItem();
prop = new ArmorProperties(0, 0, Integer.MAX_VALUE);