Minecraft-Console-Client/MinecraftClient/Mapping
BruceChen 41a701b6b2 Fix RegistryData parsing and KnownDataPacks negotiation for 1.20.6
Two critical issues in the 1.20.6 configuration phase that could cause
connection instability and packet desync:

1. RegistryData: The handler used an early `break` when it encountered
   a registryId other than "minecraft:dimension_type" or
   "minecraft:chat_type". This skipped reading the remaining entries
   for that registry, leaving unconsumed data in the packet buffer.
   Subsequent packet reads would start at the wrong offset, causing
   cascading parse failures and eventual disconnection.

   Fix: Always read all entries (entryId + hasData + optional NBT)
   for every registry, regardless of whether we process it. For
   dimension_type entries, if the server sends inline NBT data (i.e.
   non-vanilla dimensions from mods/datapacks), parse and store
   the dimension directly via World.StoreOneDimension(). Only fall
   back to hardcoded defaults when no dimension data was received.

2. KnownDataPacks: The client echoed back ALL packs the server
   listed, including non-vanilla ones. This told the server "I have
   these packs cached" when the client actually did not, so the
   server would skip sending full registry data for those packs.
   The result: incomplete registries for modded/datapack content.

   Fix: Filter the response to only include packs with the
   "minecraft" namespace. Non-vanilla packs are omitted, forcing
   the server to send their full registry data inline.

Also adds supporting methods to World.cs:
- SetDimensionIdMap(): Store VarInt ID -> dimension name mapping
  from RegistryData entries (needed by JoinGame/Respawn)
- GetDimensionNameById(): Look up dimension name by numeric ID
- HasAnyDimension(): Check if any dimensions were loaded from
  server-provided data

Made-with: Cursor
2026-03-19 00:13:22 +08:00
..
BlockPalettes Inventory, Terrain and Entity handling 2024-07-02 11:08:46 +02:00
EntityMetadataPalettes Implement 1.8 Entity MetaData 2023-03-27 18:22:50 +08:00
EntityPalettes Inventory, Terrain and Entity handling 2024-07-02 11:08:46 +02:00
Block.cs Implement command completion suggestions. 2022-12-06 15:50:17 +08:00
BlockExtension.cs Added slab handling for 1.20/.1 2023-06-23 16:25:18 +02:00
Chunk.cs Fix all warnings & Trim (#2226) 2022-10-02 18:31:08 +08:00
ChunkColumn.cs Fix all warnings & Trim (#2226) 2022-10-02 18:31:08 +08:00
CombatEventType.cs Added Player Killed event (Combat and CombatDeath packets). 2022-10-26 20:53:09 +02:00
CommandBlockFlags.cs [skip ci] Update Minecraft wiki links to new domain (#2593) 2023-10-07 17:59:08 +08:00
CommandBlockMode.cs [skip ci] Update Minecraft wiki links to new domain (#2593) 2023-10-07 17:59:08 +08:00
Dimension.cs Implement command completion suggestions. 2022-12-06 15:50:17 +08:00
Direction.cs [skip ci] Update Minecraft wiki links to new domain (#2593) 2023-10-07 17:59:08 +08:00
DirectionExtensions.cs Done auxiliary methods for Direction 2024-03-05 21:49:29 +05:00
Entity.cs merge brigadier-dev into milutinke:1.19.3 2023-01-14 20:42:15 +08:00
EntityMetadataPalette.cs Preliminary 1.21 Support 2024-12-06 16:45:48 +01:00
EntityMetaDataType.cs Implement 1.8 Entity MetaData 2023-03-27 18:22:50 +08:00
EntityPose.cs [SKIP_BUILD] Change file encoding to UTF-8 with BOM 2022-11-28 13:55:05 +08:00
EntityType.cs Inventory, Terrain and Entity handling 2024-07-02 11:08:46 +02:00
EntityTypeExtensions.cs Fix all warnings & Trim (#2226) 2022-10-02 18:31:08 +08:00
InteractType.cs Fix all warnings & Trim (#2226) 2022-10-02 18:31:08 +08:00
Location.cs Implement command completion suggestions. 2022-12-06 15:50:17 +08:00
MapIcon.cs Fix all warnings & Trim (#2226) 2022-10-02 18:31:08 +08:00
MapIconType.cs Fix all warnings & Trim (#2226) 2022-10-02 18:31:08 +08:00
Material.cs Inventory, Terrain and Entity handling 2024-07-02 11:08:46 +02:00
Material2Tool.cs Inventory, Terrain and Entity handling 2024-07-02 11:08:46 +02:00
MaterialExtensions.cs Added slab handling 1.13-1.19.4 2023-05-16 23:19:31 +02:00
MessageFilterType.cs Trim 2023-01-14 21:07:09 +08:00
Movement.cs Added slab handling 1.13-1.19.4 2023-05-16 23:19:31 +02:00
RaycastHelper.cs Implement command completion suggestions. 2022-12-06 15:50:17 +08:00
VillagerInfo.cs Adds support for villager trading (#1316) 2020-11-08 23:39:07 +01:00
World.cs Fix RegistryData parsing and KnownDataPacks negotiation for 1.20.6 2026-03-19 00:13:22 +08:00