diff --git a/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoenchants/integrations/plugins/EssentialsIntegration.kt b/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoenchants/integrations/plugins/EssentialsIntegration.kt index 751cd116..2f8b2aab 100644 --- a/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoenchants/integrations/plugins/EssentialsIntegration.kt +++ b/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoenchants/integrations/plugins/EssentialsIntegration.kt @@ -27,16 +27,16 @@ class EssentialsIntegration: EnchantRegistrationIntegration { } override fun removeEnchant(enchantment: EcoEnchant) { - Enchantments::class.java.getDeclaredField("ENCHANTMENTS") - .apply { - isAccessible = true - (get(null) as MutableMap).apply { - for (enchant in values.filterIsInstance()) { + for (field in arrayOf("ENCHANTMENTS", "ALIASENCHANTMENTS")) { + Enchantments::class.java.getDeclaredField(field) + .apply { + isAccessible = true + (get(null) as MutableMap).apply { remove(enchantment.id) remove(enchantment.id.replace("_","")) } } - } + } } override fun getPluginName() = "Essentials"