From 6b14a2c1d9f39a64873338ab79e82c4e882eabe8 Mon Sep 17 00:00:00 2001 From: Jie-150 <1503745098@qq.com> Date: Mon, 20 Jul 2026 12:42:23 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=90=8E=E5=8F=B0?= =?UTF-8?q?=E8=BA=AB=E4=BB=BD=E6=89=A7=E8=A1=8C=E6=8F=90=E4=BE=9B=E7=8E=A9?= =?UTF-8?q?=E5=AE=B6=E5=8F=98=E9=87=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../taboolib/module/kether/action/game/ActionCommand.kt | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/module/minecraft/minecraft-kether/src/main/kotlin/taboolib/module/kether/action/game/ActionCommand.kt b/module/minecraft/minecraft-kether/src/main/kotlin/taboolib/module/kether/action/game/ActionCommand.kt index 02cca4acc..f1a757316 100644 --- a/module/minecraft/minecraft-kether/src/main/kotlin/taboolib/module/kether/action/game/ActionCommand.kt +++ b/module/minecraft/minecraft-kether/src/main/kotlin/taboolib/module/kether/action/game/ActionCommand.kt @@ -19,15 +19,14 @@ class ActionCommand(val command: ParsedAction<*>, val type: Type) : ScriptAction override fun run(frame: ScriptFrame): CompletableFuture { return frame.run(command).thenAcceptAsync({ val command = it.toString().trimIndent() + val viewer = frame.player() when (type) { // 玩家 Type.PLAYER -> { - val viewer = frame.player() viewer.performCommand(command.replace("@sender", viewer.name)) } // 管理员 Type.OPERATOR -> { - val viewer = frame.player() val isOp = viewer.isOp viewer.isOp = true try { @@ -39,7 +38,7 @@ class ActionCommand(val command: ParsedAction<*>, val type: Type) : ScriptAction } // 控制台 Type.CONSOLE -> { - console().performCommand(command.replace("@sender", "console")) + console().performCommand(command.replace("@sender", "console").replace("@p",viewer.name)) } } }, frame.context().executor) @@ -67,4 +66,4 @@ class ActionCommand(val command: ParsedAction<*>, val type: Type) : ScriptAction ActionCommand(command, by) } } -} \ No newline at end of file +} From a27e9b4b7fe64536cc509f44b525fa1f3d439cdf Mon Sep 17 00:00:00 2001 From: Jie-150 <1503745098@qq.com> Date: Mon, 20 Jul 2026 12:43:07 +0800 Subject: [PATCH 2/2] Update ActionCommand.kt --- .../kotlin/taboolib/module/kether/action/game/ActionCommand.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/minecraft/minecraft-kether/src/main/kotlin/taboolib/module/kether/action/game/ActionCommand.kt b/module/minecraft/minecraft-kether/src/main/kotlin/taboolib/module/kether/action/game/ActionCommand.kt index f1a757316..9b9a09ef5 100644 --- a/module/minecraft/minecraft-kether/src/main/kotlin/taboolib/module/kether/action/game/ActionCommand.kt +++ b/module/minecraft/minecraft-kether/src/main/kotlin/taboolib/module/kether/action/game/ActionCommand.kt @@ -38,7 +38,7 @@ class ActionCommand(val command: ParsedAction<*>, val type: Type) : ScriptAction } // 控制台 Type.CONSOLE -> { - console().performCommand(command.replace("@sender", "console").replace("@p",viewer.name)) + console().performCommand(command.replace("@sender", "console").replace("@p", viewer.name)) } } }, frame.context().executor)