mirror of
https://github.com/MCCTeam/Minecraft-Console-Client
synced 2026-08-15 13:04:36 +00:00
fix: adapt chat packet format for MC 1.21.5 (protocol 770)
1.21.5 changed LastSeenMessages.Update to include a trailing checksum byte (0 = skip verification). This affects serverbound chat and signed chat command packets. Additionally, the clientbound PlayerChat packet now has a globalIndex VarInt prepended before the sender UUID. Without these fixes: - Sending plain chat messages causes DecoderException on the server - Receiving player chat messages causes Queue empty crash in MCC Made-with: Cursor
This commit is contained in:
parent
9af6c643e3
commit
26e8a2f2e6
1 changed files with 13 additions and 0 deletions
|
|
@ -1069,6 +1069,11 @@ namespace MinecraftClient.Protocol.Handlers
|
|||
// 1.19.3+
|
||||
// Header section
|
||||
// net.minecraft.network.packet.s2c.play.ChatMessageS2CPacket#write
|
||||
|
||||
// 1.21.5+: globalIndex prepended before sender UUID
|
||||
if (protocolVersion >= MC_1_21_5_Version)
|
||||
dataTypes.ReadNextVarInt(packetData);
|
||||
|
||||
var senderUuid = dataTypes.ReadNextUUID(packetData);
|
||||
var index = dataTypes.ReadNextVarInt(packetData);
|
||||
// Signature is fixed size of 256 bytes
|
||||
|
|
@ -3732,6 +3737,10 @@ namespace MinecraftClient.Protocol.Handlers
|
|||
case >= MC_1_19_3_Version:
|
||||
fields.AddRange(DataTypes.GetVarInt(messageCount1193));
|
||||
fields.AddRange(bitset1193);
|
||||
|
||||
// Checksum: Byte (1.21.5+, 0 = skip verification)
|
||||
if (protocolVersion >= MC_1_21_5_Version)
|
||||
fields.Add(0);
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
@ -3835,6 +3844,10 @@ namespace MinecraftClient.Protocol.Handlers
|
|||
|
||||
// Acknowledged: BitSet
|
||||
fields.AddRange(bitset1193);
|
||||
|
||||
// Checksum: Byte (1.21.5+, 0 = skip verification)
|
||||
if (protocolVersion >= MC_1_21_5_Version)
|
||||
fields.Add(0);
|
||||
break;
|
||||
case MC_1_19_2_Version:
|
||||
// Message Acknowledgment
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue