mirror of
https://github.com/GTNewHorizons/TinkersConstruct.git
synced 2026-11-13 17:04:24 +00:00
Battlesign reflecting takes durability and doesn't work while it's broken
This commit is contained in:
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user