Permalink
Browse files

Don't damage the tool more than it's max durability

  • Loading branch information...
1 parent 7a503ea commit cc18794a9353ee04250bac4ca487becfa4a96f74 @TfT-02 TfT-02 committed Dec 31, 2012
Showing with 2 additions and 1 deletion.
  1. +2 −1 src/main/java/com/gmail/nossr50/skills/gathering/WoodCutting.java
@@ -97,7 +97,8 @@ else if ((inHand.getDurability() + durabilityLoss >= inHand.getType().getMaxDura
}
/* Damage the tool */
- inHand.setDurability((short) (inHand.getDurability() + durabilityLoss));
+ if (inHand.getDurability() + durabilityLoss > inHand.getType().getMaxDurability()) inHand.setDurability((short) (inHand.getType().getMaxDurability()));
+ else inHand.setDurability((short) (inHand.getDurability() + durabilityLoss));
//Prepare ItemStacks
ItemStack item = null;

0 comments on commit cc18794

Please sign in to comment.