Fixed stack overflow error
This commit is contained in:
@@ -12,7 +12,12 @@ class ModifiedVanillaCraftEnchantment(
|
||||
override fun getMaxLevel(): Int = this.vanillaEnchantmentData?.maxLevel ?: super.getMaxLevel()
|
||||
|
||||
override fun conflictsWith(other: org.bukkit.enchantments.Enchantment): Boolean {
|
||||
val otherConflicts = when(other) {
|
||||
is ModifiedVanillaCraftEnchantment -> other.vanillaEnchantmentData?.conflicts?.contains(this.key) == true
|
||||
else -> other.conflictsWith(this)
|
||||
}
|
||||
|
||||
return this.vanillaEnchantmentData?.conflicts?.contains(other.key) ?: super.conflictsWith(other)
|
||||
|| other.conflictsWith(this)
|
||||
|| otherConflicts
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user