From f0a05bae4586d67baf76b625e98026bf9384a655 Mon Sep 17 00:00:00 2001 From: Auxilor Date: Wed, 20 Dec 2023 13:17:49 +0000 Subject: [PATCH] Fixed again --- .../registration/legacy/LegacyEnchantmentRegisterer.kt | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoenchants/enchant/registration/legacy/LegacyEnchantmentRegisterer.kt b/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoenchants/enchant/registration/legacy/LegacyEnchantmentRegisterer.kt index cc2888b9..69f4fc6c 100644 --- a/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoenchants/enchant/registration/legacy/LegacyEnchantmentRegisterer.kt +++ b/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoenchants/enchant/registration/legacy/LegacyEnchantmentRegisterer.kt @@ -36,6 +36,13 @@ object LegacyEnchantmentRegisterer : EnchantmentRegisterer { } override fun register(enchant: EcoEnchantBase): Enchantment { + // Allow registering new enchantments + Enchantment::class.java.getDeclaredField("acceptingNew") + .apply { + isAccessible = true + set(null, true) + } + val enchantment = LegacyDelegatedEnchantment(enchant) Enchantment.registerEnchantment(enchantment)