Permalink
Browse files

This does prevent using wood axes everytime you tree fell

  • Loading branch information...
1 parent cc18794 commit 00279502e486f9244953cad60fab4a791f51e53b @TfT-02 TfT-02 committed Dec 31, 2012
Showing with 5 additions and 2 deletions.
  1. +5 −2 src/main/java/com/gmail/nossr50/skills/gathering/WoodCutting.java
@@ -84,6 +84,8 @@ private static void removeBlocks(ArrayList<Block> toBeFelled, Player player, Pla
if (health >= 2) {
Combat.dealDamage(player, random.nextInt(health - 1));
}
+ inHand.setDurability((short) (inHand.getType().getMaxDurability()));
+ return;
}
}
else if ((inHand.getDurability() + durabilityLoss >= inHand.getType().getMaxDurability()) || inHand.getType().equals(Material.AIR)) {
@@ -94,11 +96,12 @@ else if ((inHand.getDurability() + durabilityLoss >= inHand.getType().getMaxDura
if (health >= 2) {
Combat.dealDamage(player, random.nextInt(health - 1));
}
+ inHand.setDurability((short) (inHand.getType().getMaxDurability()));
+ return;
}
/* Damage the tool */
- if (inHand.getDurability() + durabilityLoss > inHand.getType().getMaxDurability()) inHand.setDurability((short) (inHand.getType().getMaxDurability()));
- else inHand.setDurability((short) (inHand.getDurability() + durabilityLoss));
+ inHand.setDurability((short) (inHand.getDurability() + durabilityLoss));
//Prepare ItemStacks
ItemStack item = null;

0 comments on commit 0027950

Please sign in to comment.