From b6b4d7e2f814ceb472339b5cbafb9d64c90427f9 Mon Sep 17 00:00:00 2001 From: often Date: Mon, 22 Jan 2024 16:55:57 +0300 Subject: [PATCH] Fixed console commands in config slots --- .../main/java/com/willfp/eco/core/gui/slot/ConfigSlot.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/eco-api/src/main/java/com/willfp/eco/core/gui/slot/ConfigSlot.java b/eco-api/src/main/java/com/willfp/eco/core/gui/slot/ConfigSlot.java index f73734d6..b7fa5437 100644 --- a/eco-api/src/main/java/com/willfp/eco/core/gui/slot/ConfigSlot.java +++ b/eco-api/src/main/java/com/willfp/eco/core/gui/slot/ConfigSlot.java @@ -86,7 +86,7 @@ public class ConfigSlot extends CustomSlot { for (String command : config.getStrings(configKey)) { if (command.startsWith("console:")) { commands.add(new CommandToDispatch( - StringUtils.removePrefix("console:", command), + StringUtils.removePrefix(command, "console:"), true )); } else { @@ -127,12 +127,16 @@ public class ConfigSlot extends CustomSlot { * @param player The player. */ void dispatch(@NotNull final Player player) { + System.out.println("DISPATCHING " + command); + if (console()) { + System.out.println("CONSOLE"); Bukkit.dispatchCommand( Bukkit.getConsoleSender(), command().replace("%player%", player.getName()) ); } else { + System.out.println("NON-CONSOLE"); Bukkit.dispatchCommand( player, command().replace("%player%", player.getName())