mirror of
https://github.com/PaperMC/Paper.git
synced 2026-11-25 10:29:41 -05:00
Implemented Enchantment.conflictsWith(). Addresses BUKKIT-1159
This commit is contained in:
1 parent
28c1f571d2
commit
f219f0efe9
1 file changed
+12
@@ -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);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user