make trusted broadcast log in console

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

View file

@ -4,11 +4,10 @@
<option name="autoReloadType" value="SELECTIVE" />
</component>
<component name="ChangeListManager">
<list default="true" id="50f184fa-7bed-4956-baf5-7586ff26ea08" name="Changes" comment="i forgor 1 thing lmfao">
<change afterPath="$PROJECT_DIR$/src/main/java/land/chipmunk/chayapak/chomens_bot/commands/SeenCommand.java" afterDir="false" />
<list default="true" id="50f184fa-7bed-4956-baf5-7586ff26ea08" name="Changes" comment="gex">
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/java/land/chipmunk/chayapak/chomens_bot/plugins/CommandHandlerPlugin.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/land/chipmunk/chayapak/chomens_bot/plugins/CommandHandlerPlugin.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/java/land/chipmunk/chayapak/chomens_bot/plugins/PlayersPlugin.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/land/chipmunk/chayapak/chomens_bot/plugins/PlayersPlugin.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/java/land/chipmunk/chayapak/chomens_bot/plugins/LoggerPlugin.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/land/chipmunk/chayapak/chomens_bot/plugins/LoggerPlugin.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/java/land/chipmunk/chayapak/chomens_bot/plugins/TrustedPlugin.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/land/chipmunk/chayapak/chomens_bot/plugins/TrustedPlugin.java" afterDir="false" />
</list>
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
@ -100,13 +99,6 @@
<option name="presentableId" value="Default" />
<updated>1680245437032</updated>
</task>
<task id="LOCAL-00070" summary="improve rtp">
<created>1681638481198</created>
<option name="number" value="00070" />
<option name="presentableId" value="LOCAL-00070" />
<option name="project" value="LOCAL" />
<updated>1681638481198</updated>
</task>
<task id="LOCAL-00071" summary="forgor that i used displayname">
<created>1681638788599</created>
<option name="number" value="00071" />
@ -443,7 +435,14 @@
<option name="project" value="LOCAL" />
<updated>1682343832831</updated>
</task>
<option name="localTasksCounter" value="119" />
<task id="LOCAL-00119" summary="gex">
<created>1682401544373</created>
<option name="number" value="00119" />
<option name="presentableId" value="LOCAL-00119" />
<option name="project" value="LOCAL" />
<updated>1682401544374</updated>
</task>
<option name="localTasksCounter" value="120" />
<servers />
</component>
<component name="Vcs.Log.Tabs.Properties">
@ -458,7 +457,6 @@
</option>
</component>
<component name="VcsManagerConfiguration">
<MESSAGE value="readme i guess" />
<MESSAGE value="change a bit mabe" />
<MESSAGE value="improve reconnect i guess" />
<MESSAGE value="make better console logging like the old js chomens bot" />
@ -483,7 +481,8 @@
<MESSAGE value="thanks blackilykat for solving the thing.,.,.,&#10;yes just change the thing to null and its all done" />
<MESSAGE value="fix chomens bot crsah exploit 2023 working" />
<MESSAGE value="i forgor 1 thing lmfao" />
<option name="LAST_COMMIT_MESSAGE" value="i forgor 1 thing lmfao" />
<MESSAGE value="gex" />
<option name="LAST_COMMIT_MESSAGE" value="gex" />
</component>
<component name="XSLT-Support.FileAssociations.UIState">
<expand />

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);