From cc7cc0f08f81774e9d02f657604757ad2aa367f1 Mon Sep 17 00:00:00 2001 From: Auxilor Date: Thu, 13 Apr 2023 12:44:46 -0400 Subject: [PATCH] Fixed display not working for some users --- .../src/main/kotlin/com/willfp/ecoenchants/display/Sorters.kt | 4 ---- .../com/willfp/ecoenchants/rarity/EnchantmentRarities.kt | 3 +++ .../kotlin/com/willfp/ecoenchants/type/EnchantmentTypes.kt | 3 +++ 3 files changed, 6 insertions(+), 4 deletions(-) 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) } }