mirror of
https://github.com/Auxilor/EcoEnchants.git
synced 2025-02-08 03:11:19 +01:00
Fixed display not working for some users
This commit is contained in:
parent
19c0cca3b5
commit
cc7cc0f08f
@ -57,8 +57,6 @@ object LengthSorter : EnchantmentSorter {
|
|||||||
object TypeSorter : EnchantmentSorter {
|
object TypeSorter : EnchantmentSorter {
|
||||||
private val types = mutableListOf<EnchantmentType>()
|
private val types = mutableListOf<EnchantmentType>()
|
||||||
|
|
||||||
@JvmStatic
|
|
||||||
@ConfigUpdater
|
|
||||||
fun update(plugin: EcoEnchantsPlugin) {
|
fun update(plugin: EcoEnchantsPlugin) {
|
||||||
types.clear()
|
types.clear()
|
||||||
types.addAll(plugin.configYml.getStrings("display.sort.type-order").mapNotNull {
|
types.addAll(plugin.configYml.getStrings("display.sort.type-order").mapNotNull {
|
||||||
@ -86,8 +84,6 @@ object TypeSorter : EnchantmentSorter {
|
|||||||
object RaritySorter : EnchantmentSorter {
|
object RaritySorter : EnchantmentSorter {
|
||||||
private val rarities = mutableListOf<EnchantmentRarity>()
|
private val rarities = mutableListOf<EnchantmentRarity>()
|
||||||
|
|
||||||
@JvmStatic
|
|
||||||
@ConfigUpdater
|
|
||||||
fun update(plugin: EcoEnchantsPlugin) {
|
fun update(plugin: EcoEnchantsPlugin) {
|
||||||
rarities.clear()
|
rarities.clear()
|
||||||
rarities.addAll(plugin.configYml.getStrings("display.sort.rarity-order").mapNotNull {
|
rarities.addAll(plugin.configYml.getStrings("display.sort.rarity-order").mapNotNull {
|
||||||
|
@ -2,6 +2,7 @@ package com.willfp.ecoenchants.rarity
|
|||||||
|
|
||||||
import com.willfp.eco.core.registry.Registry
|
import com.willfp.eco.core.registry.Registry
|
||||||
import com.willfp.ecoenchants.EcoEnchantsPlugin
|
import com.willfp.ecoenchants.EcoEnchantsPlugin
|
||||||
|
import com.willfp.ecoenchants.display.RaritySorter
|
||||||
|
|
||||||
@Suppress("UNUSED")
|
@Suppress("UNUSED")
|
||||||
object EnchantmentRarities : Registry<EnchantmentRarity>() {
|
object EnchantmentRarities : Registry<EnchantmentRarity>() {
|
||||||
@ -12,5 +13,7 @@ object EnchantmentRarities : Registry<EnchantmentRarity>() {
|
|||||||
for (config in plugin.rarityYml.getSubsections("rarities")) {
|
for (config in plugin.rarityYml.getSubsections("rarities")) {
|
||||||
register(EnchantmentRarity(config))
|
register(EnchantmentRarity(config))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
RaritySorter.update(plugin)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2,6 +2,7 @@ package com.willfp.ecoenchants.type
|
|||||||
|
|
||||||
import com.willfp.eco.core.registry.Registry
|
import com.willfp.eco.core.registry.Registry
|
||||||
import com.willfp.ecoenchants.EcoEnchantsPlugin
|
import com.willfp.ecoenchants.EcoEnchantsPlugin
|
||||||
|
import com.willfp.ecoenchants.display.TypeSorter
|
||||||
|
|
||||||
@Suppress("UNUSED")
|
@Suppress("UNUSED")
|
||||||
object EnchantmentTypes: Registry<EnchantmentType>() {
|
object EnchantmentTypes: Registry<EnchantmentType>() {
|
||||||
@ -18,5 +19,7 @@ object EnchantmentTypes: Registry<EnchantmentType>() {
|
|||||||
for (config in plugin.typesYml.getSubsections("types")) {
|
for (config in plugin.typesYml.getSubsections("types")) {
|
||||||
register(EnchantmentType(plugin, config))
|
register(EnchantmentType(plugin, config))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TypeSorter.update(plugin)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user