Skip to content

Commit

Permalink
Fix SystemChatPacket: Support reading packet properly in newer MC ver…
Browse files Browse the repository at this point in the history
…sions (#1461)
  • Loading branch information
shoker537 authored Nov 19, 2024
1 parent cefa3b2 commit 9cfcfcf
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,11 @@ public ComponentHolder getComponent() {
@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
Expand Down

0 comments on commit 9cfcfcf

Please sign in to comment.