mirror of
https://github.com/Auxilor/EcoEnchants.git
synced 2024-11-21 14:55:17 +01:00
Fixed stack overflow error
This commit is contained in:
parent
3f3b836232
commit
5c6e6ee49e
@ -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
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user