SPIGOT-2481: Implement EnchantmentTarget.BREAKABLE

By: md_5 <git@md-5.net>
This commit is contained in:
Bukkit/Spigot 2016-07-08 12:51:29 +10:00
parent ef24ef29c8
commit 0c42c407cf

View File

@ -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;
}
};
/**