Fixed display not working for some users

This commit is contained in:
Auxilor 2023-04-13 12:44:46 -04:00
parent 19c0cca3b5
commit cc7cc0f08f
3 changed files with 6 additions and 4 deletions

View File

@ -57,8 +57,6 @@ object LengthSorter : EnchantmentSorter {
object TypeSorter : EnchantmentSorter {
private val types = mutableListOf<EnchantmentType>()
@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<EnchantmentRarity>()
@JvmStatic
@ConfigUpdater
fun update(plugin: EcoEnchantsPlugin) {
rarities.clear()
rarities.addAll(plugin.configYml.getStrings("display.sort.rarity-order").mapNotNull {

View File

@ -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<EnchantmentRarity>() {
@ -12,5 +13,7 @@ object EnchantmentRarities : Registry<EnchantmentRarity>() {
for (config in plugin.rarityYml.getSubsections("rarities")) {
register(EnchantmentRarity(config))
}
RaritySorter.update(plugin)
}
}

View File

@ -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<EnchantmentType>() {
@ -18,5 +19,7 @@ object EnchantmentTypes: Registry<EnchantmentType>() {
for (config in plugin.typesYml.getSubsections("types")) {
register(EnchantmentType(plugin, config))
}
TypeSorter.update(plugin)
}
}