Skip to content

Commit fd3bcb9

Browse files
authored
Merge pull request #171 from YsGqHY/stable/v3
Async Save Data
2 parents e45f5dc + 263ee7f commit fd3bcb9

File tree

4 files changed

+9
-8
lines changed

4 files changed

+9
-8
lines changed

build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ plugins {
55
java
66
idea
77
kotlin("jvm") version "2.1.0"
8-
id("io.izzel.taboolib") version "2.0.22"
8+
id("io.izzel.taboolib") version "2.0.23"
99
}
1010

1111
// 这段。一言难尽,但我不想动 (依托)

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
group=me.arasple.mc.trmenu
2-
version=3.5.0
2+
version=3.5.1

plugin/src/main/kotlin/trplugins/menu/module/internal/data/Metadata.kt

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,9 @@ object Metadata {
7979
}
8080

8181
fun saveData(player: Player, key: String) {
82-
MetaDataDao.door.update(DataEntity(player, key, getData(player)[key]?.toString() ?: ""))
82+
submitAsync {
83+
MetaDataDao.door.update(DataEntity(player, key, getData(player)[key]?.toString() ?: ""))
84+
}
8385
}
8486

8587
fun pushData(player: Player, dataMap: DataMap = getData(player)) {
@@ -150,7 +152,9 @@ object Metadata {
150152
globalData[key] = value
151153
} else {
152154
global[key] = value
153-
GlobalDataDao.door.update(key, value)
155+
submitAsync {
156+
GlobalDataDao.door.update(key, value)
157+
}
154158
}
155159
}
156160

plugin/src/main/kotlin/trplugins/menu/module/internal/hook/impl/HookSkinsRestorer.kt

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,13 @@ package trplugins.menu.module.internal.hook.impl
33
import net.skinsrestorer.api.SkinsRestorer
44
import net.skinsrestorer.api.SkinsRestorerProvider
55
import trplugins.menu.module.internal.hook.HookAbstract
6-
import trplugins.menu.module.internal.script.Bindings
76

87
/**
98
* @author Arasple
109
* @date 2021/1/27 14:12
1110
*/
1211
class HookSkinsRestorer : HookAbstract() {
1312

14-
15-
1613
private val skinsRestorer: SkinsRestorer? =
1714
if (plugin != null && plugin!!.isEnabled) {
1815
runCatching { SkinsRestorerProvider.get() }.getOrNull()
@@ -25,7 +22,7 @@ class HookSkinsRestorer : HookAbstract() {
2522
}
2623

2724
override val isHooked by lazy {
28-
if (Bindings.exportHook) bindingScript()
25+
if (plugin?.isEnabled == false) return@lazy false
2926
return@lazy skinsRestorer != null
3027
}
3128

0 commit comments

Comments
 (0)