File tree Expand file tree Collapse file tree 4 files changed +33
-6
lines changed
plugin/src/main/kotlin/trplugins/menu
module/internal/script/js Expand file tree Collapse file tree 4 files changed +33
-6
lines changed Original file line number Diff line number Diff line change @@ -72,7 +72,7 @@ subprojects {
7272 disableOnSkippedVersion = false
7373 }
7474 version {
75- taboolib = " 6.2.4-5902762 "
75+ taboolib = " 6.2.4-8d51195 "
7676 coroutines = null
7777 }
7878 }
Original file line number Diff line number Diff line change 11group =me.arasple.mc.trmenu
2- version =3.9.16
2+ version =3.9.17
Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ import org.bukkit.entity.Player
44import taboolib.common.platform.ProxyPlayer
55import taboolib.common.platform.function.submit
66import taboolib.expansion.dispatchCommandAsOp
7+ import taboolib.platform.util.runTask
78import trplugins.menu.api.action.ActionHandle
89import trplugins.menu.api.action.base.ActionBase
910import trplugins.menu.api.action.base.ActionContents
@@ -22,23 +23,24 @@ class CommandOp(handle: ActionHandle) : ActionBase(handle) {
2223
2324 override fun onExecute (contents : ActionContents , player : ProxyPlayer , placeholderPlayer : ProxyPlayer ) {
2425 val fakeOp = player.session().menu?.settings?.commandFakeOp ? : true
26+ val bukkitPlayer = player.cast<Player >()
2527 contents.stringContent().parseContentSplited(placeholderPlayer, " ;" ).forEach {
26- submit(async = false ) {
28+ bukkitPlayer.location.runTask( {
2729 if (fakeOp) {
28- player.cast< Player >() .dispatchCommandAsOp(it)
30+ bukkitPlayer .dispatchCommandAsOp(it)
2931 } else {
3032 player.isOp.let { isOp ->
3133 player.isOp = true
3234 try {
33- player .performCommand(it)
35+ bukkitPlayer .performCommand(it)
3436 } catch (e: Throwable ) {
3537 e.printStackTrace()
3638 } finally {
3739 player.isOp = isOp
3840 }
3941 }
4042 }
41- }
43+ })
4244 }
4345 }
4446
Original file line number Diff line number Diff line change 11package trplugins.menu.module.internal.script.js
22
33import com.google.common.collect.Maps
4+ import taboolib.common.env.RuntimeDependencies
5+ import taboolib.common.env.RuntimeDependency
46import taboolib.common5.compileJS
57import trplugins.menu.util.EvalResult
68import javax.script.CompiledScript
79import javax.script.SimpleScriptContext
810
11+ @RuntimeDependencies(
12+ RuntimeDependency (
13+ " !org.ow2.asm:asm:9.7.1" ,
14+ test = " !jdk.nashorn.api.scripting.NashornScriptEngineFactory"
15+ ),
16+ RuntimeDependency (
17+ " !org.ow2.asm:asm-commons:9.7.1" ,
18+ test = " !jdk.nashorn.api.scripting.NashornScriptEngineFactory"
19+ ),
20+ RuntimeDependency (
21+ " !org.ow2.asm:asm-tree:9.7.1" ,
22+ test = " !jdk.nashorn.api.scripting.NashornScriptEngineFactory"
23+ ),
24+ RuntimeDependency (
25+ " !org.ow2.asm:asm-util:9.7.1" ,
26+ test = " !jdk.nashorn.api.scripting.NashornScriptEngineFactory"
27+ ),
28+ RuntimeDependency (
29+ " !org.ow2.asm:asm-analysis:9.7.1" ,
30+ test = " !jdk.nashorn.api.scripting.NashornScriptEngineFactory"
31+ )
32+ )
33+
934object NashornAgent {
1035 private val compiledScripts = Maps .newConcurrentMap<String , CompiledScript >();
1136 fun preCompile (script : String ): CompiledScript {
You can’t perform that action at this time.
0 commit comments