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

View file

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