SPIGOT-5811: Re-add + deprecate EnchantmentTarget.ALL

By: md_5 <git@md-5.net>
This commit is contained in:
Bukkit/Spigot 2020-06-26 08:15:22 +10:00
parent 95cf31d8b8
commit c9776be30d

View File

@ -8,6 +8,24 @@ import org.jetbrains.annotations.NotNull;
* Represents the applicable target for a {@link Enchantment}
*/
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