diff options
author | Celtic Minstrel <celtic.minstrel.ca@some.place> | 2012-03-12 15:32:46 -0400 |
---|---|---|
committer | EvilSeph <evilseph@gmail.com> | 2012-03-13 22:23:33 -0400 |
commit | f219f0efe95c3a62b66a920303e65812e4b3c052 (patch) | |
tree | d176e661fccce8a7009186c109ab678597896eb0 | |
parent | 28c1f571d25100ae6cee24bffedcee28c1ccf790 (diff) | |
download | craftbukkit-f219f0efe95c3a62b66a920303e65812e4b3c052.tar craftbukkit-f219f0efe95c3a62b66a920303e65812e4b3c052.tar.gz craftbukkit-f219f0efe95c3a62b66a920303e65812e4b3c052.tar.lz craftbukkit-f219f0efe95c3a62b66a920303e65812e4b3c052.tar.xz craftbukkit-f219f0efe95c3a62b66a920303e65812e4b3c052.zip |
Implemented Enchantment.conflictsWith(). Addresses BUKKIT-1159
-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); + } } |