mirror of
https://github.com/PaperMC/Paper.git
synced 2025-03-15 12:02:49 +01:00
Implemented Enchantment.conflictsWith(). Addresses BUKKIT-1159
This commit is contained in:
parent
28c1f571d2
commit
f219f0efe9
1 changed files with 12 additions and 0 deletions
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue