mirror of
https://github.com/PaperMC/Paper.git
synced 2025-03-20 14:08:57 +01:00
SPIGOT-5811: Re-add + deprecate EnchantmentTarget.ALL
By: md_5 <git@md-5.net>
This commit is contained in:
parent
95cf31d8b8
commit
c9776be30d
1 changed files with 18 additions and 0 deletions
|
@ -8,6 +8,24 @@ import org.jetbrains.annotations.NotNull;
|
||||||
* Represents the applicable target for a {@link Enchantment}
|
* Represents the applicable target for a {@link Enchantment}
|
||||||
*/
|
*/
|
||||||
public enum EnchantmentTarget {
|
public enum EnchantmentTarget {
|
||||||
|
/**
|
||||||
|
* Allows the Enchantment to be placed on all items
|
||||||
|
*
|
||||||
|
* @deprecated this target no longer exists in Vanilla
|
||||||
|
*/
|
||||||
|
@Deprecated
|
||||||
|
ALL {
|
||||||
|
@Override
|
||||||
|
public boolean includes(@NotNull Material item) {
|
||||||
|
for (EnchantmentTarget target : EnchantmentTarget.values()) {
|
||||||
|
if (target != this && target.includes(item)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Allows the Enchantment to be placed on armor
|
* Allows the Enchantment to be placed on armor
|
||||||
|
|
Loading…
Add table
Reference in a new issue