Route chat output through LocalPlayer.displayClientMessage
Some checks failed
continuous-integration/drone/push Build is failing

Gui.chat is private in 26.2 and Gui.getChat() is gone, so the previous
direct-field access does not compile. Player.displayClientMessage is a
public, stable API for client-side chat output, so push everything
through it. When the player is null (e.g. on the title screen before
join, where the auto-connect "Connected to ..." line lands), fall back
to the logger so the message is not silently dropped.
This commit is contained in:
2026-06-21 16:07:19 +06:00
parent b0501acfcd
commit 0e6377fce1

View File

@@ -112,8 +112,10 @@ public final class ClientIrcMod implements ClientModInitializer {
return;
}
client.execute(() -> {
if (client.gui != null && client.gui.chat != null) {
client.gui.chat.addMessage(text);
if (client.player != null) {
client.player.displayClientMessage(text, false);
} else {
LOGGER.info(text.getString());
}
});
}