fix eco enchant again
Some checks failed
Java CI with Gradle / build (push) Has been cancelled

This commit is contained in:
alexcrea 2026-08-14 00:40:52 +02:00
parent 75b32bcf52
commit 643a5e9a8c
Signed by: alexcrea
GPG key ID: E59DF23EE2A2266C
2 changed files with 14 additions and 11 deletions

View file

@ -22,7 +22,7 @@ plugins {
}
group = "xyz.alexcrea"
version = "2.0.0"
version = "2.0.1"
val isDevBuild = System.getenv("SMALL_COMMIT_HASH") != null
val isPreRelease = System.getenv("IS_GITHUB_PRERELEASE") == "true"

View file

@ -5,6 +5,7 @@ import com.willfp.ecoenchants.enchant.EcoEnchant
import com.willfp.ecoenchants.enchant.EcoEnchants
import com.willfp.ecoenchants.enchant.UtilKt
import io.delilaheve.CustomAnvil
import org.bukkit.Bukkit
import org.bukkit.event.inventory.PrepareAnvilEvent
import org.bukkit.plugin.Plugin
import xyz.alexcrea.cuanvil.api.EnchantmentApi
@ -34,12 +35,14 @@ class EcoEnchantDependency(private val ecoEnchantPlugin: Plugin) {
}
public fun getEcoLevelLimit(): Int {
fun getEcoLevelLimit(): Int {
return UtilKt.infiniteIfNegative((ecoEnchantPlugin as EcoPlugin).configYml.getInt("anvil.enchant-limit"))
}
fun disableAnvilListener() {
PrepareAnvilEvent.getHandlerList().unregister(this.ecoEnchantPlugin)
// I don't like that but modern ee use eco prepare anvil event
PrepareAnvilEvent.getHandlerList().unregister(Bukkit.getPluginManager().getPlugin("eco")!!)
}
private var ecoEnchantOldEnchantments: MutableSet<EcoEnchant>? = null