From 869b64b2dc8a88d3aa40c60818a7a38cb796a95f Mon Sep 17 00:00:00 2001 From: Auxilor Date: Fri, 2 Sep 2022 12:02:33 +0100 Subject: [PATCH] ess again --- .../plugins/EssentialsIntegration.kt | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 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 3c70bf3a..751cd116 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 @@ -13,16 +13,16 @@ class EssentialsIntegration: EnchantRegistrationIntegration { for (enchantment in EcoEnchants.values()) { // why aren't you using the api you PRd in // because essentials named mending to repairing etc - Enchantments::class.java.getDeclaredField("ENCHANTMENTS") - .apply { - isAccessible = true - (get(null) as MutableMap).apply { - put(enchantment.id, enchantment) - put(enchantment.id.replace("_",""), enchantment) + for (field in arrayOf("ENCHANTMENTS", "ALIASENCHANTMENTS")) { + Enchantments::class.java.getDeclaredField(field) + .apply { + isAccessible = true + (get(null) as MutableMap).apply { + put(enchantment.id, enchantment) + put(enchantment.id.replace("_",""), enchantment) + } } - } - - Enchantments.registerEnchantment(enchantment.id, enchantment) + } } }