Skip to content

Commit

Permalink
Battlesign reflecting takes durability and doesn't work while it's br…
Browse files Browse the repository at this point in the history
…oken
  • Loading branch information
bonii-xx committed Nov 30, 2014
1 parent 4981355 commit af6fbec
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/main/java/tconstruct/tools/TinkerToolEvents.java
Expand Up @@ -222,8 +222,12 @@ public void onAttack (LivingAttackEvent event)
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())
{
Expand Down Expand Up @@ -282,6 +286,9 @@ public void onAttack (LivingAttackEvent event)
attacker.attackEntityFrom(DamageSource.causeThornsDamage(player), event.ammount);
}
}

// durability--
AbilityHelper.damageTool(stack, (int)Math.ceil(event.ammount/2f), player, false);
}
}
}
Expand Down

0 comments on commit af6fbec

Please sign in to comment.