diff options
-rw-r--r-- | src/main/java/org/bukkit/craftbukkit/enchantments/CraftEnchantment.java | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/main/java/org/bukkit/craftbukkit/enchantments/CraftEnchantment.java b/src/main/java/org/bukkit/craftbukkit/enchantments/CraftEnchantment.java index e4c68847..e40c00a8 100644 --- a/src/main/java/org/bukkit/craftbukkit/enchantments/CraftEnchantment.java +++ b/src/main/java/org/bukkit/craftbukkit/enchantments/CraftEnchantment.java @@ -116,4 +116,16 @@ public class CraftEnchantment extends Enchantment { return null; } + + @Override + public boolean conflictsWith(Enchantment other) { + if (other instanceof EnchantmentWrapper) { + other = ((EnchantmentWrapper) other).getEnchantment(); + } + if (!(other instanceof CraftEnchantment)) { + return false; + } + CraftEnchantment ench = (CraftEnchantment) other; + return !target.a(ench.target); + } } |