diff --git a/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoenchants/display/Sorters.kt b/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoenchants/display/Sorters.kt index f4882dde..2c1901b2 100644 --- a/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoenchants/display/Sorters.kt +++ b/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoenchants/display/Sorters.kt @@ -57,8 +57,6 @@ object LengthSorter : EnchantmentSorter { object TypeSorter : EnchantmentSorter { private val types = mutableListOf() - @JvmStatic - @ConfigUpdater fun update(plugin: EcoEnchantsPlugin) { types.clear() types.addAll(plugin.configYml.getStrings("display.sort.type-order").mapNotNull { @@ -86,8 +84,6 @@ object TypeSorter : EnchantmentSorter { object RaritySorter : EnchantmentSorter { private val rarities = mutableListOf() - @JvmStatic - @ConfigUpdater fun update(plugin: EcoEnchantsPlugin) { rarities.clear() rarities.addAll(plugin.configYml.getStrings("display.sort.rarity-order").mapNotNull { diff --git a/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoenchants/rarity/EnchantmentRarities.kt b/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoenchants/rarity/EnchantmentRarities.kt index e73e38c7..6aff647c 100644 --- a/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoenchants/rarity/EnchantmentRarities.kt +++ b/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoenchants/rarity/EnchantmentRarities.kt @@ -2,6 +2,7 @@ package com.willfp.ecoenchants.rarity import com.willfp.eco.core.registry.Registry import com.willfp.ecoenchants.EcoEnchantsPlugin +import com.willfp.ecoenchants.display.RaritySorter @Suppress("UNUSED") object EnchantmentRarities : Registry() { @@ -12,5 +13,7 @@ object EnchantmentRarities : Registry() { for (config in plugin.rarityYml.getSubsections("rarities")) { register(EnchantmentRarity(config)) } + + RaritySorter.update(plugin) } } diff --git a/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoenchants/type/EnchantmentTypes.kt b/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoenchants/type/EnchantmentTypes.kt index 9d840677..52482fd2 100644 --- a/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoenchants/type/EnchantmentTypes.kt +++ b/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoenchants/type/EnchantmentTypes.kt @@ -2,6 +2,7 @@ package com.willfp.ecoenchants.type import com.willfp.eco.core.registry.Registry import com.willfp.ecoenchants.EcoEnchantsPlugin +import com.willfp.ecoenchants.display.TypeSorter @Suppress("UNUSED") object EnchantmentTypes: Registry() { @@ -18,5 +19,7 @@ object EnchantmentTypes: Registry() { for (config in plugin.typesYml.getSubsections("types")) { register(EnchantmentType(plugin, config)) } + + TypeSorter.update(plugin) } }