From 84a984f2f6236dee20cabc238719c49ef8948412 Mon Sep 17 00:00:00 2001 From: ChomeNS <95471003+ChomeNS@users.noreply.github.com> Date: Tue, 9 May 2023 16:42:25 +0700 Subject: [PATCH] make trusted broadcast not confusing in console --- .../chomens_bot/plugins/TrustedPlugin.java | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/main/java/land/chipmunk/chayapak/chomens_bot/plugins/TrustedPlugin.java b/src/main/java/land/chipmunk/chayapak/chomens_bot/plugins/TrustedPlugin.java index 9696bad..4a11a24 100644 --- a/src/main/java/land/chipmunk/chayapak/chomens_bot/plugins/TrustedPlugin.java +++ b/src/main/java/land/chipmunk/chayapak/chomens_bot/plugins/TrustedPlugin.java @@ -26,7 +26,14 @@ public class TrustedPlugin extends PlayersPlugin.Listener { for (Bot bot : bot.bots()) { if (!bot.loggedIn()) continue; - bot.logger().custom(Component.text("Trusted Broadcast").color(NamedTextColor.AQUA), message); + final Component component = Component.translatable( + "[%s] [%s] %s", + Component.text("ChomeNS Bot").color(NamedTextColor.YELLOW), + Component.text(this.bot.options().serverName()).color(NamedTextColor.GRAY), + message.color(NamedTextColor.WHITE) + ).color(NamedTextColor.DARK_GRAY); + + bot.logger().custom(Component.text("Trusted Broadcast").color(NamedTextColor.AQUA), component); for (String player : list) { final MutablePlayerListEntry entry = bot.players().getEntry(player); @@ -35,13 +42,6 @@ public class TrustedPlugin extends PlayersPlugin.Listener { if (entry.profile().getId() == exceptTarget) continue; - final Component component = Component.translatable( - "[%s] [%s] %s", - Component.text("ChomeNS Bot").color(NamedTextColor.YELLOW), - Component.text(this.bot.options().serverName()).color(NamedTextColor.GRAY), - message.color(NamedTextColor.WHITE) - ).color(NamedTextColor.DARK_GRAY); - bot.chat().tellraw(component, player); } }