From fa80f5f67fcd0fd58bf2a22de639d504e73d494f Mon Sep 17 00:00:00 2001 From: wizjany Date: Mon, 18 Mar 2013 13:20:30 -0400 Subject: [PATCH] Fix infinite durability. For whatever reason, the Bukkit API thinks that 'Durability" and "Damage" are synonymous. --- .../com/sk89q/worldguard/bukkit/WorldGuardBlockListener.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/sk89q/worldguard/bukkit/WorldGuardBlockListener.java b/src/main/java/com/sk89q/worldguard/bukkit/WorldGuardBlockListener.java index 0b70ce00..c0353264 100644 --- a/src/main/java/com/sk89q/worldguard/bukkit/WorldGuardBlockListener.java +++ b/src/main/java/com/sk89q/worldguard/bukkit/WorldGuardBlockListener.java @@ -140,7 +140,7 @@ public void onBlockBreak(BlockBreakEvent event) { if (held.getTypeId() > 0 && !(ItemType.usesDamageValue(held.getTypeId()) || BlockType.usesData(held.getTypeId()))) { - held.setDurability(Material.getMaterial(held.getTypeId()).getMaxDurability()); + held.setDurability((short) 0); player.setItemInHand(held); } }