mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-09 19:49:35 +01:00
SPIGOT-2481: Implement EnchantmentTarget.BREAKABLE
By: md_5 <git@md-5.net>
This commit is contained in:
parent
ef24ef29c8
commit
0c42c407cf
1 changed files with 10 additions and 0 deletions
|
@ -150,6 +150,16 @@ public enum EnchantmentTarget {
|
||||||
public boolean includes(Material item) {
|
public boolean includes(Material item) {
|
||||||
return item.equals(Material.FISHING_ROD);
|
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 a new issue