mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-08 09:17:36 +01:00
SPIGOT-2481: Implement EnchantmentTarget.BREAKABLE
By: md_5 <git@md-5.net>
This commit is contained in:
parent
ef24ef29c8
commit
0c42c407cf
@ -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;
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user