mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-03 23:07:40 +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
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user