@@ -42,6 +42,8 @@ import trplugins.menu.util.collections.IndivList
4242import trplugins.menu.util.conf.Property
4343import trplugins.menu.util.parseIconId
4444import java.io.File
45+ import java.util.concurrent.ConcurrentHashMap
46+ import kotlin.collections.forEach
4547import kotlin.jvm.optionals.getOrNull
4648import kotlin.math.max
4749
@@ -104,10 +106,10 @@ object MenuSerializer : ISerializer {
104106 }
105107
106108 // 读取菜单语言
107- val lang: Map <String , HashMap <String , taboolib.module.lang.Type >>? = if (languages.isEmpty()) null else {
108- val map = HashMap <String , HashMap <String , taboolib.module.lang.Type >>()
109+ val lang: Map <String , ConcurrentHashMap <String , taboolib.module.lang.Type >>? = if (languages.isEmpty()) null else {
110+ val map = mutableMapOf <String , ConcurrentHashMap <String , taboolib.module.lang.Type >>()
109111 languages.forEach { entry ->
110- val nodes = serializeLocaleNodes(entry.key, entry.value, HashMap ())
112+ val nodes = serializeLocaleNodes(entry.key, entry.value, ConcurrentHashMap ())
111113 if (nodes.isNotEmpty()) {
112114 map[entry.key.lowercase()] = nodes
113115 }
@@ -432,7 +434,7 @@ object MenuSerializer : ISerializer {
432434 // Method body taken from Taboolib, licensed under the MIT License
433435 //
434436 // Copyright (c) 2018 Bkm016
435- private fun serializeLocaleNodes (code : String , file : ConfigurationSection , nodes : HashMap <String , taboolib.module.lang.Type >, root : String = ""): HashMap <String , taboolib.module.lang.Type > {
437+ private fun serializeLocaleNodes (code : String , file : ConfigurationSection , nodes : ConcurrentHashMap <String , taboolib.module.lang.Type >, root : String = ""): ConcurrentHashMap <String , taboolib.module.lang.Type > {
436438 file.getKeys(false ).forEach { node ->
437439 val key = " $root$node "
438440 when (val obj = file[node]) {
0 commit comments