File tree Expand file tree Collapse file tree 5 files changed +40
-4
lines changed
src/main/kotlin/trplugins/menu/api
plugin/src/main/resources/lang Expand file tree Collapse file tree 5 files changed +40
-4
lines changed Original file line number Diff line number Diff line change @@ -2,6 +2,11 @@ dependencies {
2
2
api(project(" :common" ))
3
3
4
4
compileOnly(" net.md-5:bungeecord-chat:1.18-R0.1-SNAPSHOT" )
5
+
6
+
7
+ // Folia
8
+ compileOnly(" io.paper:folia-api:1.20.4" )
9
+
5
10
}
6
11
7
12
taboolib { subproject = true }
Original file line number Diff line number Diff line change @@ -2,9 +2,11 @@ package trplugins.menu.api.action.impl.send
2
2
3
3
import taboolib.common.platform.ProxyPlayer
4
4
import taboolib.common.platform.function.submit
5
+ import taboolib.platform.Folia
5
6
import trplugins.menu.api.action.ActionHandle
6
7
import trplugins.menu.api.action.base.ActionBase
7
8
import trplugins.menu.api.action.base.ActionContents
9
+ import trplugins.menu.api.utils.FoliaUtil
8
10
9
11
/* *
10
12
* TrMenu
@@ -19,8 +21,13 @@ class Command(handle: ActionHandle) : ActionBase(handle) {
19
21
20
22
override fun onExecute (contents : ActionContents , player : ProxyPlayer , placeholderPlayer : ProxyPlayer ) {
21
23
placeholderPlayer.parseContentSplited(contents.stringContent(), " ;" ).forEach {
22
- submit(async = false ) {
23
- player.performCommand(it)
24
+ // Folia 必须使用实体调度器 暂时不做优雅的兼容性处理 后期其他功能需要单独处理Folia时再修改
25
+ if (Folia .isFolia) {
26
+ FoliaUtil .invokeCommandWithEntityScheduler(player,it)
27
+ }else {
28
+ submit(async = false ) {
29
+ player.performCommand(it)
30
+ }
24
31
}
25
32
}
26
33
}
Original file line number Diff line number Diff line change
1
+ package trplugins.menu.api.utils
2
+
3
+ import io.papermc.paper.threadedregions.scheduler.EntityScheduler
4
+ import taboolib.common.platform.ProxyPlayer
5
+ import taboolib.library.reflex.Reflex.Companion.invokeMethod
6
+ import taboolib.platform.BukkitPlugin
7
+
8
+ /* *
9
+ * @author 大阔
10
+ * @since 2025/1/25 00:16
11
+ */
12
+ object FoliaUtil {
13
+
14
+ fun invokeCommandWithEntityScheduler (player : ProxyPlayer ,command : String ){
15
+ getEntityScheduler(player).execute(BukkitPlugin .getInstance(),{
16
+ player.performCommand(command)
17
+ },null ,0 )
18
+ }
19
+
20
+ fun getEntityScheduler (player : ProxyPlayer ): EntityScheduler {
21
+ return player.cast<Any >().invokeMethod<EntityScheduler >(" getScheduler" )!!
22
+ }
23
+
24
+ }
Original file line number Diff line number Diff line change 1
1
group =me.arasple.mc.trmenu
2
- version =3.3.7
2
+ version =3.3.8
Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ Plugin-Update:
8
8
- ' &bhttps://www.spigotmc.org/resources/83120/'
9
9
Plugin-Version :
10
10
- ' &8[&3Tr&bMenu&8] &b版本 &8| &3你正在使用社区维护版本:'
11
- - ' &bhttps://github.com/Dreeam-qwq /TrMenu'
11
+ - ' &bhttps://github.com/Coderkuo /TrMenu'
12
12
Plugin-Dependency-Hooked : ' &8[&3Tr&bMenu&8] &6挂钩 &8| &7软依赖 &f{0} &7已兼容.'
13
13
Plugin-Dependency-Abuse : ' &8[&3Tr&bMenu&8] &6挂钩 &8| &4试图使用未挂钩插件 &c{0}'
14
14
You can’t perform that action at this time.
0 commit comments