From cff14ebf9e88d519944883e3215425382d9622da Mon Sep 17 00:00:00 2001 From: ChomeNS <95471003+ChomeNS@users.noreply.github.com> Date: Thu, 7 Sep 2023 19:56:51 +0700 Subject: [PATCH] whatever useless shit idfk --- .../chayapak/chomens_bot/command/CommandContext.java | 2 ++ .../chomens_bot/command/PlayerCommandContext.java | 9 ++++++++- .../chomens_bot/plugins/CommandHandlerPlugin.java | 1 + 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/main/java/land/chipmunk/chayapak/chomens_bot/command/CommandContext.java b/src/main/java/land/chipmunk/chayapak/chomens_bot/command/CommandContext.java index 1dfb055..f76ce58 100644 --- a/src/main/java/land/chipmunk/chayapak/chomens_bot/command/CommandContext.java +++ b/src/main/java/land/chipmunk/chayapak/chomens_bot/command/CommandContext.java @@ -13,6 +13,8 @@ public class CommandContext { public final boolean inGame; + public String commandName = null; + public String[] splitInput; public CommandContext(Bot bot, String prefix, PlayerEntry sender, boolean inGame) { diff --git a/src/main/java/land/chipmunk/chayapak/chomens_bot/command/PlayerCommandContext.java b/src/main/java/land/chipmunk/chayapak/chomens_bot/command/PlayerCommandContext.java index f15aacf..a89232e 100644 --- a/src/main/java/land/chipmunk/chayapak/chomens_bot/command/PlayerCommandContext.java +++ b/src/main/java/land/chipmunk/chayapak/chomens_bot/command/PlayerCommandContext.java @@ -20,7 +20,14 @@ public class PlayerCommandContext extends CommandContext { @Override public void sendOutput (Component message) { - bot.chat.tellraw(message, selector); + bot.chat.tellraw( + Component.translatable( + "%s", + message, + Component.text("chomens_bot_command_output" + ((commandName != null) ? "_" + commandName : "")) + ), + selector + ); } @Override diff --git a/src/main/java/land/chipmunk/chayapak/chomens_bot/plugins/CommandHandlerPlugin.java b/src/main/java/land/chipmunk/chayapak/chomens_bot/plugins/CommandHandlerPlugin.java index f90ee8c..3bdf7b7 100644 --- a/src/main/java/land/chipmunk/chayapak/chomens_bot/plugins/CommandHandlerPlugin.java +++ b/src/main/java/land/chipmunk/chayapak/chomens_bot/plugins/CommandHandlerPlugin.java @@ -157,6 +157,7 @@ public class CommandHandlerPlugin { if (!console && command.consoleOnly) return Component.text("This command can only be ran via console").color(NamedTextColor.RED); context.splitInput = splitInput; + context.commandName = command.name; try { return command.execute(context, args, fullArgs);