diff options
Diffstat (limited to 'src/main')
-rw-r--r-- | src/main/java/org/bukkit/enchantments/EnchantmentTarget.java | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/main/java/org/bukkit/enchantments/EnchantmentTarget.java b/src/main/java/org/bukkit/enchantments/EnchantmentTarget.java index d9b98ed6..dee2350d 100644 --- a/src/main/java/org/bukkit/enchantments/EnchantmentTarget.java +++ b/src/main/java/org/bukkit/enchantments/EnchantmentTarget.java @@ -150,6 +150,16 @@ public enum EnchantmentTarget { public boolean includes(Material item) { return item.equals(Material.FISHING_ROD); } + }, + + /** + * Allows the enchantment to be placed on items with durability. + */ + BREAKABLE { + @Override + public boolean includes(Material item) { + return item.getMaxDurability() > 0 && item.getMaxStackSize() == 1; + } }; /** |