mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-10 10:17:38 +01:00
Implemented Enchantment.conflictsWith(). Addresses BUKKIT-1159
By: Celtic Minstrel <celtic.minstrel.ca@some.place>
This commit is contained in:
parent
70900406c9
commit
67f275fc78
@ -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…
Reference in New Issue
Block a user