make trusted broadcast log in console

This commit is contained in:
ChomeNS
2023-04-25 12:52:42 +07:00
parent 090d38610c
commit 189aee90f9
3 changed files with 21 additions and 14 deletions

View File

@@ -81,6 +81,12 @@ public class LoggerPlugin extends ChatPlugin.ChatListener {
bot.console().reader().printAbove(message);
}
public void custom (Component prefix, Component _message) {
final String message = prefix(prefix, ComponentUtilities.stringifyAnsi(_message));
bot.console().reader().printAbove(message);
}
@Override
public void systemMessageReceived(Component component) {
final String ansiMessage = ComponentUtilities.stringifyAnsi(component);

View File

@@ -26,6 +26,8 @@ public class TrustedPlugin extends PlayersPlugin.PlayerListener {
for (Bot bot : bot.allBots()) {
if (!bot.loggedIn()) continue;
bot.logger().custom(Component.text("Trusted Broadcast").color(NamedTextColor.AQUA), message);
for (String player : list) {
final MutablePlayerListEntry entry = bot.players().getEntry(player);