From 66f7754b78d1bc10d5a59640a8253072d4adea82 Mon Sep 17 00:00:00 2001 From: ChomeNS <95471003+ChomeNS@users.noreply.github.com> Date: Wed, 7 May 2025 19:24:34 +0700 Subject: [PATCH] fix: clearchat not showing translation (lmao) --- build-number.txt | 2 +- .../commands/ClearChatCommand.java | 29 +++++++++++-------- 2 files changed, 18 insertions(+), 13 deletions(-) diff --git a/build-number.txt b/build-number.txt index d1c3966d..f594fd99 100644 --- a/build-number.txt +++ b/build-number.txt @@ -1 +1 @@ -3165 \ No newline at end of file +3166 \ No newline at end of file diff --git a/src/main/java/me/chayapak1/chomens_bot/commands/ClearChatCommand.java b/src/main/java/me/chayapak1/chomens_bot/commands/ClearChatCommand.java index 49cd3957..5336828f 100644 --- a/src/main/java/me/chayapak1/chomens_bot/commands/ClearChatCommand.java +++ b/src/main/java/me/chayapak1/chomens_bot/commands/ClearChatCommand.java @@ -33,27 +33,32 @@ public class ClearChatCommand extends Command { if (!name.isEmpty()) { final PlayerEntry entry = bot.players.getEntry(name); - if (entry == null) throw new CommandException(Component.translatable("commands.generic.error.invalid_player")); + if (entry == null) + throw new CommandException(Component.translatable("commands.generic.error.invalid_player")); final UUID uuid = entry.profile.getId(); bot.chat.tellraw( - Component.empty() - .append(Component.text("\n".repeat(1000))) - .append( - Component.translatable( - "commands.clearchat.specific", - NamedTextColor.DARK_GREEN, - context.displayName() + bot.commandHandler.renderTranslatable( + Component.empty() + .append(Component.text("\n".repeat(1000))) + .append( + Component.translatable( + "commands.clearchat.specific", + NamedTextColor.DARK_GREEN, + context.displayName() + ) ) - ), + ), uuid ); } else { bot.chat.tellraw( - Component.empty() - .append(Component.text("\n".repeat(1000))) - .append(Component.translatable("commands.clearchat.everyone").color(NamedTextColor.DARK_GREEN)) + bot.commandHandler.renderTranslatable( + Component.empty() + .append(Component.text("\n".repeat(1000))) + .append(Component.translatable("commands.clearchat.everyone", NamedTextColor.DARK_GREEN)) + ) ); }