From d4c6ab37e8257e0e74875ac8920e43377911ffe6 Mon Sep 17 00:00:00 2001 From: William Gaylord Date: Wed, 27 Dec 2023 17:18:56 -0600 Subject: [PATCH] 1.20.2 Protocol fixes (#812) * Fix Chunk Batch Start All other new and changed packets now match up to MC source for 1.20.2 * Fix Chunk Unload packet coord ordering * Fix chunk_biomes packet. Seems this packet has been incorrect since 1.19.4 when it was introduced. * update packet_chunk_biomes * fix --------- Co-authored-by: extremeheat --- data/pc/1.19.3/protocol.json | 22 +++++++++++++++-- data/pc/1.19.4/protocol.json | 37 ++++++++++++++++++++++++--- data/pc/1.20.2/protocol.json | 48 +++++++++++++++++++++++++++--------- data/pc/1.20/protocol.json | 37 ++++++++++++++++++++++++--- 4 files changed, 125 insertions(+), 19 deletions(-) diff --git a/data/pc/1.19.3/protocol.json b/data/pc/1.19.3/protocol.json index 77ba04dbc..1ee516df5 100644 --- a/data/pc/1.19.3/protocol.json +++ b/data/pc/1.19.3/protocol.json @@ -286,6 +286,24 @@ } ] ], + "soundSource": [ + "mapper", + { + "type": "varint", + "mappings": { + "0": "master", + "1": "music", + "2": "record", + "3": "weather", + "4": "block", + "5": "hostile", + "6": "neutral", + "7": "player", + "8": "ambient", + "9": "voice" + } + } + ], "previousMessages": [ "array", { @@ -4412,7 +4430,7 @@ }, { "name": "soundCategory", - "type": "varint" + "type": "soundSource" }, { "name": "entityId", @@ -4506,7 +4524,7 @@ }, { "name": "soundCategory", - "type": "varint" + "type": "soundSource" }, { "name": "x", diff --git a/data/pc/1.19.4/protocol.json b/data/pc/1.19.4/protocol.json index 45d3ee6da..ecd0cf60f 100644 --- a/data/pc/1.19.4/protocol.json +++ b/data/pc/1.19.4/protocol.json @@ -341,6 +341,37 @@ } ] ], + "packedChunkPos": [ + "container", + [ + { + "name": "z", + "type": "i32" + }, + { + "name": "x", + "type": "i32" + } + ] + ], + "soundSource": [ + "mapper", + { + "type": "varint", + "mappings": { + "0": "master", + "1": "music", + "2": "record", + "3": "weather", + "4": "block", + "5": "hostile", + "6": "neutral", + "7": "player", + "8": "ambient", + "9": "voice" + } + } + ], "previousMessages": [ "array", { @@ -4600,7 +4631,7 @@ }, { "name": "soundCategory", - "type": "varint" + "type": "soundSource" }, { "name": "entityId", @@ -4694,7 +4725,7 @@ }, { "name": "soundCategory", - "type": "varint" + "type": "soundSource" }, { "name": "x", @@ -5355,7 +5386,7 @@ [ { "name": "position", - "type": "position" + "type": "packedChunkPos" }, { "name": "data", diff --git a/data/pc/1.20.2/protocol.json b/data/pc/1.20.2/protocol.json index f33479cb1..c3d121f8e 100644 --- a/data/pc/1.20.2/protocol.json +++ b/data/pc/1.20.2/protocol.json @@ -341,6 +341,37 @@ } ] ], + "soundSource": [ + "mapper", + { + "type": "varint", + "mappings": { + "0": "master", + "1": "music", + "2": "record", + "3": "weather", + "4": "block", + "5": "hostile", + "6": "neutral", + "7": "player", + "8": "ambient", + "9": "voice" + } + } + ], + "packedChunkPos": [ + "container", + [ + { + "name": "z", + "type": "i32" + }, + { + "name": "x", + "type": "i32" + } + ] + ], "previousMessages": [ "array", { @@ -2444,12 +2475,7 @@ ], "packet_chunk_batch_start": [ "container", - [ - { - "name": "batchSize", - "type": "varint" - } - ] + [] ], "packet_tab_complete": [ "container", @@ -2886,11 +2912,11 @@ "container", [ { - "name": "chunkX", + "name": "chunkZ", "type": "i32" }, { - "name": "chunkZ", + "name": "chunkX", "type": "i32" } ] @@ -4856,7 +4882,7 @@ }, { "name": "soundCategory", - "type": "varint" + "type": "soundSource" }, { "name": "entityId", @@ -4950,7 +4976,7 @@ }, { "name": "soundCategory", - "type": "varint" + "type": "soundSource" }, { "name": "x", @@ -5588,7 +5614,7 @@ [ { "name": "position", - "type": "position" + "type": "packedChunkPos" }, { "name": "data", diff --git a/data/pc/1.20/protocol.json b/data/pc/1.20/protocol.json index fa6e2bfc7..044c84b28 100644 --- a/data/pc/1.20/protocol.json +++ b/data/pc/1.20/protocol.json @@ -341,6 +341,37 @@ } ] ], + "packedChunkPos": [ + "container", + [ + { + "name": "z", + "type": "i32" + }, + { + "name": "x", + "type": "i32" + } + ] + ], + "soundSource": [ + "mapper", + { + "type": "varint", + "mappings": { + "0": "master", + "1": "music", + "2": "record", + "3": "weather", + "4": "block", + "5": "hostile", + "6": "neutral", + "7": "player", + "8": "ambient", + "9": "voice" + } + } + ], "previousMessages": [ "array", { @@ -4596,7 +4627,7 @@ }, { "name": "soundCategory", - "type": "varint" + "type": "soundSource" }, { "name": "entityId", @@ -4690,7 +4721,7 @@ }, { "name": "soundCategory", - "type": "varint" + "type": "soundSource" }, { "name": "x", @@ -5334,7 +5365,7 @@ [ { "name": "position", - "type": "position" + "type": "packedChunkPos" }, { "name": "data",