@@ -55,12 +55,27 @@ public void playerLoggedOut(ServerPlayer e) {
5555// }
5656// }
5757
58- public void serverChat (ServerPlayer player , ChatEvent .ChatComponent component ) {
58+ public void formatServerChat (ServerPlayer player , ChatEvent .ChatComponent component ) {
5959 Component chatComponent = component .get ().copy ();
6060 String content = SIBUtil .getRawText (chatComponent );
6161 component .set (SimpleIRCBridgeCommon .newChatWithLinks (content , false ));
62- if (player != null ) {
63- String playername = player .getName ().getString ();
62+ }
63+
64+ public EventResult livingDeath (LivingEntity livingEntity , DamageSource damageSource ) {
65+ if (livingEntity instanceof ServerPlayer ) {
66+ toIrc (String .format (FORMAT1_MC_DEATH , damageSource .getLocalizedDeathMessage (livingEntity ).getString ().replace (livingEntity .getName ().toString (), SIBUtil .mangle (livingEntity .getName ().toString ())) ));
67+ }
68+ return EventResult .pass ();
69+ }
70+
71+ private void toIrc (String s ) {
72+ this .bridge .sendToIrc (s );
73+ }
74+
75+ public EventResult serverChat (ServerPlayer serverPlayer , Component component ) {
76+ String content = SIBUtil .getRawText (component );
77+ if (serverPlayer != null ) {
78+ String playername = SIBUtil .mangle (serverPlayer .getName ().getString ());
6479 if (Config .ircFormatting ) {
6580 content = IRCMinecraftConverter .convMinecraftToIRC (content );
6681 }
@@ -71,16 +86,7 @@ public void serverChat(ServerPlayer player, ChatEvent.ChatComponent component) {
7186 }
7287 toIrc (String .format (FORMAT2_MC_CHAT , "Server" , content ));
7388 }
74- }
7589
76- public EventResult livingDeath (LivingEntity livingEntity , DamageSource damageSource ) {
77- if (livingEntity instanceof ServerPlayer ) {
78- toIrc (String .format (FORMAT1_MC_DEATH , damageSource .getLocalizedDeathMessage (livingEntity ).getString ().replace (livingEntity .getName ().toString (), SIBUtil .mangle (livingEntity .getName ().toString ())) ));
79- }
8090 return EventResult .pass ();
8191 }
82-
83- private void toIrc (String s ) {
84- this .bridge .sendToIrc (s );
85- }
8692}
0 commit comments