mirror of
https://github.com/PaperMC/Paper.git
synced 2025-08-14 19:55:52 -07:00
SPIGOT-2481: Implement EnchantmentTarget.BREAKABLE
By: md_5 <git@md-5.net>
This commit is contained in:
@@ -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;
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user