From 4751f9046965f288f477d331e5fd176bcbab85a7 Mon Sep 17 00:00:00 2001 From: md_5 Date: Mon, 19 Feb 2018 20:48:15 +1100 Subject: Add missing WEARABLE EnchantmentTarget --- .../java/org/bukkit/enchantments/EnchantmentTarget.java | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/main/java/org/bukkit/enchantments/EnchantmentTarget.java b/src/main/java/org/bukkit/enchantments/EnchantmentTarget.java index c0f47b66..61067912 100644 --- a/src/main/java/org/bukkit/enchantments/EnchantmentTarget.java +++ b/src/main/java/org/bukkit/enchantments/EnchantmentTarget.java @@ -160,6 +160,20 @@ public enum EnchantmentTarget { public boolean includes(Material item) { return item.getMaxDurability() > 0 && item.getMaxStackSize() == 1; } + }, + + /** + * Allows the enchantment to be placed on wearable items. + */ + WEARABLE { + @Override + public boolean includes(Material item) { + return ARMOR.includes(item) + || item.equals(Material.ELYTRA) + || item.equals(Material.PUMPKIN) + || item.equals(Material.JACK_O_LANTERN) + || item.equals(Material.SKULL_ITEM); + } }; /** -- cgit v1.2.3