Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ subprojects {
disableOnSkippedVersion = false
}
version {
taboolib = "6.2.4-5902762"
taboolib = "6.2.4-8d51195"
coroutines = null
}
}
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
group=me.arasple.mc.trmenu
version=3.9.16
version=3.9.17
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import org.bukkit.entity.Player
import taboolib.common.platform.ProxyPlayer
import taboolib.common.platform.function.submit
import taboolib.expansion.dispatchCommandAsOp
import taboolib.platform.util.runTask
import trplugins.menu.api.action.ActionHandle
import trplugins.menu.api.action.base.ActionBase
import trplugins.menu.api.action.base.ActionContents
Expand All @@ -22,23 +23,24 @@ class CommandOp(handle: ActionHandle) : ActionBase(handle) {

override fun onExecute(contents: ActionContents, player: ProxyPlayer, placeholderPlayer: ProxyPlayer) {
val fakeOp = player.session().menu?.settings?.commandFakeOp ?: true
val bukkitPlayer = player.cast<Player>()
contents.stringContent().parseContentSplited(placeholderPlayer, ";").forEach {
submit(async = false) {
bukkitPlayer.location.runTask( {
if (fakeOp) {
player.cast<Player>().dispatchCommandAsOp(it)
bukkitPlayer.dispatchCommandAsOp(it)
} else {
player.isOp.let { isOp ->
player.isOp = true
try {
player.performCommand(it)
bukkitPlayer.performCommand(it)
} catch (e: Throwable) {
e.printStackTrace()
} finally {
player.isOp = isOp
}
}
}
}
})
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,36 @@
package trplugins.menu.module.internal.script.js

import com.google.common.collect.Maps
import taboolib.common.env.RuntimeDependencies
import taboolib.common.env.RuntimeDependency
import taboolib.common5.compileJS
import trplugins.menu.util.EvalResult
import javax.script.CompiledScript
import javax.script.SimpleScriptContext

@RuntimeDependencies(
RuntimeDependency(
"!org.ow2.asm:asm:9.7.1",
test = "!jdk.nashorn.api.scripting.NashornScriptEngineFactory"
),
RuntimeDependency(
"!org.ow2.asm:asm-commons:9.7.1",
test = "!jdk.nashorn.api.scripting.NashornScriptEngineFactory"
),
RuntimeDependency(
"!org.ow2.asm:asm-tree:9.7.1",
test = "!jdk.nashorn.api.scripting.NashornScriptEngineFactory"
),
RuntimeDependency(
"!org.ow2.asm:asm-util:9.7.1",
test = "!jdk.nashorn.api.scripting.NashornScriptEngineFactory"
),
RuntimeDependency(
"!org.ow2.asm:asm-analysis:9.7.1",
test = "!jdk.nashorn.api.scripting.NashornScriptEngineFactory"
)
)

object NashornAgent {
private val compiledScripts = Maps.newConcurrentMap<String, CompiledScript>();
fun preCompile(script: String): CompiledScript {
Expand Down