Update chat and GameProfile accessors for 26.2
Some checks failed
continuous-integration/drone/push Build is failing
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:
@@ -112,15 +112,15 @@ public final class ClientIrcMod implements ClientModInitializer {
|
||||
return;
|
||||
}
|
||||
client.execute(() -> {
|
||||
if (client.gui != null && client.gui.getChat() != null) {
|
||||
client.gui.getChat().addMessage(text);
|
||||
if (client.gui != null && client.gui.chat != null) {
|
||||
client.gui.chat.addMessage(text);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private static String resolvePlayerName(Minecraft client) {
|
||||
if (client != null && client.player != null) {
|
||||
return client.player.getGameProfile().getName();
|
||||
return client.player.getGameProfile().name();
|
||||
}
|
||||
if (client != null && client.getUser() != null) {
|
||||
return client.getUser().getName();
|
||||
|
||||
Reference in New Issue
Block a user