From 675d0d616e53e52ccbbf67c8b754f8d46c413aec Mon Sep 17 00:00:00 2001 From: yoyosource Date: Sun, 25 Dec 2022 00:14:50 +0100 Subject: [PATCH] Fix script calling other command without expression replacement --- .../steamwar/bausystem/features/script/ScriptExecutor.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/script/ScriptExecutor.java b/BauSystem_Main/src/de/steamwar/bausystem/features/script/ScriptExecutor.java index 1c50aa9d..110b2a13 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/script/ScriptExecutor.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/script/ScriptExecutor.java @@ -156,15 +156,15 @@ public final class ScriptExecutor { continue; } + // Variable Replaces in commands. + command = String.join(" ", strings); + PlayerCommandPreprocessEvent preprocessEvent = new PlayerCommandPreprocessEvent(player, "/" + (specialCommand != null && command.startsWith(specialCommand) ? "script:" : "") + command); Bukkit.getServer().getPluginManager().callEvent(preprocessEvent); if (preprocessEvent.isCancelled()) { continue; } - // Variable Replaces in commands. - command = String.join(" ", strings); - Bukkit.getLogger().log(Level.INFO, player.getName() + " dispatched command: " + command); if (!strings[0].equals("select") && hasFAWE && WorldEditListener.isWorldEditCommand("/" + strings[0])) { EditSession editSession = WorldEditUtils.getEditSession(player.getWorld());