Battlesign reflecting takes durability and doesn't work while it's broken

This commit is contained in:
Bernhard Bonigl committed 2014-11-30 14:34:28 +01:00
1 parent 49813550b4
commit af6fbec293
1 file changed
+8 -1
@@ -222,8 +222,12 @@ public class TinkerToolEvents
EntityPlayer player = (EntityPlayer) event.entityLiving;
//Cutlass
ItemStack stack = player.getCurrentEquippedItem();
if (stack != null && stack.getItem() == TinkerTools.battlesign && player.isUsingItem())
if (stack != null && stack.getItem() == TinkerTools.battlesign)
{
// broken battlesign?
if(!stack.hasTagCompound() || stack.getTagCompound().getCompoundTag("InfiTool").getBoolean("Broken"))
return;
DamageSource source = event.source;
if (!source.isUnblockable() && !source.isMagicDamage() && !source.isExplosion())
{
@@ -282,6 +286,9 @@ public class TinkerToolEvents
attacker.attackEntityFrom(DamageSource.causeThornsDamage(player), event.ammount);
}
}
// durability--
AbilityHelper.damageTool(stack, (int)Math.ceil(event.ammount/2f), player, false);
}
}
}