From 6c478a26c4e6e8bfb16765403e39ce6f7cc84861 Mon Sep 17 00:00:00 2001 From: GJ Date: Mon, 25 Nov 2013 09:29:41 -0500 Subject: [PATCH] Fix issue with custom axes not working with Tree Feller. Most custom materials don't properly report their max durability, so we need to use our repairable manager to handle them instead. --- .../java/com/gmail/nossr50/skills/woodcutting/Woodcutting.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/gmail/nossr50/skills/woodcutting/Woodcutting.java b/src/main/java/com/gmail/nossr50/skills/woodcutting/Woodcutting.java index a6d95cf75..5d28a8129 100644 --- a/src/main/java/com/gmail/nossr50/skills/woodcutting/Woodcutting.java +++ b/src/main/java/com/gmail/nossr50/skills/woodcutting/Woodcutting.java @@ -209,6 +209,7 @@ public final class Woodcutting { */ protected static boolean handleDurabilityLoss(Set treeFellerBlocks, ItemStack inHand) { short durabilityLoss = 0; + Material type = inHand.getType(); for (BlockState blockState : treeFellerBlocks) { if (BlockUtils.isLog(blockState)) { @@ -217,7 +218,7 @@ public final class Woodcutting { } SkillUtils.handleDurabilityChange(inHand, durabilityLoss); - return (inHand.getDurability() < inHand.getType().getMaxDurability()); + return (inHand.getDurability() < (mcMMO.getRepairableManager().isRepairable(type) ? mcMMO.getRepairableManager().getRepairable(type).getMaximumDurability() : type.getMaxDurability())); } /**