From 593c8efa8c5c592abcaa4bb8978b2f18bd66b811 Mon Sep 17 00:00:00 2001 From: Auxilor Date: Fri, 2 Sep 2022 12:02:50 +0100 Subject: [PATCH] ess again --- .../integrations/plugins/EssentialsIntegration.kt | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) 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"