From 709783c1313d28d96375c4e944af6b36a33d7285 Mon Sep 17 00:00:00 2001 From: Senmori Date: Tue, 25 Oct 2016 11:16:50 -0400 Subject: [PATCH] Add Enchantment#isTreasure()Z Determines if the enchantment is a treasure enchantment - only available via means other than the enchantment table. --- .../bukkit/craftbukkit/enchantments/CraftEnchantment.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/main/java/org/bukkit/craftbukkit/enchantments/CraftEnchantment.java b/src/main/java/org/bukkit/craftbukkit/enchantments/CraftEnchantment.java index 12337bf17a..78a535a9a8 100644 --- a/src/main/java/org/bukkit/craftbukkit/enchantments/CraftEnchantment.java +++ b/src/main/java/org/bukkit/craftbukkit/enchantments/CraftEnchantment.java @@ -54,6 +54,11 @@ public class CraftEnchantment extends Enchantment { } } + @Override + public boolean isTreasure() { + return target.e(); // PAIL: isTreasure + } + @Override public boolean canEnchantItem(ItemStack item) { return target.canEnchant(CraftItemStack.asNMSCopy(item));