From 5f9233bc3b026cb1f83a5405eca0cc6e201c528c Mon Sep 17 00:00:00 2001 From: Olof Larsson Date: Thu, 2 Apr 2015 13:38:22 +0200 Subject: [PATCH] A minor addition to isRepairable --- src/com/massivecraft/massivecore/util/InventoryUtil.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/com/massivecraft/massivecore/util/InventoryUtil.java b/src/com/massivecraft/massivecore/util/InventoryUtil.java index 3d8817ea..8463c5cd 100644 --- a/src/com/massivecraft/massivecore/util/InventoryUtil.java +++ b/src/com/massivecraft/massivecore/util/InventoryUtil.java @@ -278,6 +278,10 @@ public class InventoryUtil // However we add this in anyways for future compatibility. if ( ! material.getData().equals(MaterialData.class)) return false; + // We may also not repair things that can not take any damage. + // NOTE: MaxDurability should be renamed to MaxDamage. + if (material.getMaxDurability() == 0) return false; + // Otherwise repairable return true; }