13
0
geforkt von Mirrors/Velocity

Fix SystemChatPacket: Support reading packet properly in newer MC versions (#1461)

Dieser Commit ist enthalten in:
Andrey 2024-11-19 20:49:17 +03:00 committet von GitHub
Ursprung cefa3b272e
Commit 9cfcfcf2ed
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: B5690EEEBB952194

Datei anzeigen

@ -47,8 +47,11 @@ public class SystemChatPacket implements MinecraftPacket {
@Override
public void decode(ByteBuf buf, ProtocolUtils.Direction direction, ProtocolVersion version) {
component = ComponentHolder.read(buf, version);
// System chat is never decoded so this doesn't matter for now
type = ChatType.values()[ProtocolUtils.readVarInt(buf)];
if (version.noLessThan(ProtocolVersion.MINECRAFT_1_19_1)){
type = buf.readBoolean() ? ChatType.GAME_INFO : ChatType.SYSTEM;
} else {
type = ChatType.values()[ProtocolUtils.readVarInt(buf)];
}
}
@Override