bugfix: Fixed teams packet crash

This commit is contained in:
Anon 2026-04-04 14:32:12 +02:00 committed by GitHub
commit 23262de6c2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -3049,7 +3049,7 @@ namespace MinecraftClient.Protocol.Handlers
// nameTagVisibility, collisionRule, color (VarInt),
// prefix (component), suffix (component)
// method 0/3/4: players list (VarInt count + strings)
// 1.21.9+ (protocol 773): nameTagVisibility and collisionRule are
// 1.21.5+ (protocol 770): nameTagVisibility and collisionRule are
// VarInt-encoded enum IDs instead of UTF strings.
var teamName = dataTypes.ReadNextString(packetData);
var teamMethod = dataTypes.ReadNextByte(packetData);
@ -3068,7 +3068,7 @@ namespace MinecraftClient.Protocol.Handlers
teamFriendlyFlags = dataTypes.ReadNextByte(packetData);
// nameTagVisibility
if (protocolVersion >= MC_1_21_9_Version)
if (protocolVersion >= MC_1_21_5_Version)
{
// STREAM_CODEC: 0=always, 1=never, 2=hideForOtherTeams, 3=hideForOwnTeam
teamNameTagVisibility = dataTypes.ReadNextVarInt(packetData) switch
@ -3086,7 +3086,7 @@ namespace MinecraftClient.Protocol.Handlers
}
// collisionRule
if (protocolVersion >= MC_1_21_9_Version)
if (protocolVersion >= MC_1_21_5_Version)
{
// STREAM_CODEC: 0=always, 1=never, 2=pushOtherTeams, 3=pushOwnTeam
teamCollisionRule = dataTypes.ReadNextVarInt(packetData) switch