Update chat and GameProfile accessors for 26.2
Some checks failed
continuous-integration/drone/push Build is failing

In 26.2 Mojang dropped the getChat() wrapper on Gui in favour of the
public 'chat' field, and com.mojang.authlib.GameProfile is now a record
so its getter is name() rather than getName(). Reflect both changes in
the IRC chat dispatcher.
This commit is contained in:
2026-06-21 16:03:52 +06:00
parent 5f366792c3
commit b0501acfcd

View File

@@ -112,15 +112,15 @@ public final class ClientIrcMod implements ClientModInitializer {
return; return;
} }
client.execute(() -> { client.execute(() -> {
if (client.gui != null && client.gui.getChat() != null) { if (client.gui != null && client.gui.chat != null) {
client.gui.getChat().addMessage(text); client.gui.chat.addMessage(text);
} }
}); });
} }
private static String resolvePlayerName(Minecraft client) { private static String resolvePlayerName(Minecraft client) {
if (client != null && client.player != null) { if (client != null && client.player != null) {
return client.player.getGameProfile().getName(); return client.player.getGameProfile().name();
} }
if (client != null && client.getUser() != null) { if (client != null && client.getUser() != null) {
return client.getUser().getName(); return client.getUser().getName();