From bd18618d5ff4964b6ae4cffb7a7452fab9686f81 Mon Sep 17 00:00:00 2001 From: aericio <16523741+Aericio@users.noreply.github.com> Date: Thu, 28 Sep 2023 15:46:04 -1000 Subject: [PATCH] Fix disable-enchantment not working --- src/DaPigGuy/PiggyCustomEnchants/CustomEnchantManager.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/DaPigGuy/PiggyCustomEnchants/CustomEnchantManager.php b/src/DaPigGuy/PiggyCustomEnchants/CustomEnchantManager.php index 30eb007b..b1d2739b 100644 --- a/src/DaPigGuy/PiggyCustomEnchants/CustomEnchantManager.php +++ b/src/DaPigGuy/PiggyCustomEnchants/CustomEnchantManager.php @@ -230,13 +230,13 @@ public static function unregisterEnchantment(int|CustomEnchant $id): void self::$plugin->getLogger()->debug("Custom Enchantment '" . $enchant->getDisplayName() . "' unregistered with id " . $enchant->getId()); unset(self::$enchants[$id]); - $property = new ReflectionProperty(EnchantmentIdMap::class, "enchToId"); + $property = new ReflectionProperty(EnchantmentIdMap::class, "enumToId"); $property->setAccessible(true); $value = $property->getValue(EnchantmentIdMap::getInstance()); unset($value[spl_object_id(EnchantmentIdMap::getInstance()->fromId($id))]); $property->setValue(EnchantmentIdMap::getInstance(), $value); - $property = new ReflectionProperty(EnchantmentIdMap::class, "idToEnch"); + $property = new ReflectionProperty(EnchantmentIdMap::class, "idToEnum"); $property->setAccessible(true); $value = $property->getValue(EnchantmentIdMap::getInstance()); unset($value[$id]);