Minecraft-Console-Client/MinecraftClient
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
..
ChatBots Handle non-interactive terminal environments gracefully 2026-03-19 00:11:13 +08:00
CommandHandler [skip ci] Miscellaneous scripting QoL improvements and fixes (#2740) 2024-06-22 06:40:23 +08:00
Commands Handle non-interactive terminal environments gracefully 2026-03-19 00:11:13 +08:00
config Merge into master 2022-12-06 20:32:46 +08:00
Crypto Trim 2023-01-14 21:07:09 +08:00
Inventory Preliminary 1.21 Support 2024-12-06 16:45:48 +01:00
Logger Implement command completion suggestions. 2022-12-06 15:50:17 +08:00
Mapping Fix RegistryData parsing and KnownDataPacks negotiation for 1.20.6 2026-03-19 00:13:22 +08:00
Properties Fix all warnings & Trim (#2226) 2022-10-02 18:31:08 +08:00
Protocol Fix RegistryData parsing and KnownDataPacks negotiation for 1.20.6 2026-03-19 00:13:22 +08:00
Proxy Tooltip support & Bug fix 2022-12-11 13:00:19 +08:00
Resources Add Sentry Error Tracking (#2670) 2024-06-22 06:41:13 +08:00
Scripting Merge branch 'master' into 1.20.6 2025-12-02 00:06:16 +08:00
WinAPI Bug fix 2022-10-10 10:56:12 +08:00
AutoTimeout.cs Fix all warnings & Trim (#2226) 2022-10-02 18:31:08 +08:00
ColorHelper.cs legacy color support 2022-12-14 14:45:51 +08:00
Command.cs Bug fix 2022-12-11 16:30:45 +08:00
ConsoleIO.cs fixed typo in word heAlper lol 2024-04-16 21:21:08 +03:00
ExtensionMethods.cs Better translation 2022-10-17 20:00:33 +08:00
FileMonitor.cs Remove color code from text 2022-11-30 16:08:55 +08:00
INIFile.cs [skip ci] Normalize all line endings 2023-09-15 14:44:11 +08:00
Json.cs Re-added WebSocketChat bot and improved it, no longer using WebsocketSharp library 2023-05-27 19:46:28 +02:00
McClient.cs Merge branch 'master' into 1.20.6 2025-12-02 00:06:16 +08:00
MinecraftClient.csproj Ported to .NET 8 2024-12-22 13:20:04 +01:00
Program.cs Handle non-interactive terminal environments gracefully 2026-03-19 00:11:13 +08:00
Settings.cs Temporarily removed WebSocket bot because of a false positive virus detection. I will make it in to a standalone bot later. 2025-05-22 13:56:27 +02:00
TaskWithDelay.cs Fix all warnings & Trim (#2226) 2022-10-02 18:31:08 +08:00
TaskWithResult.cs Fix all warnings & Trim (#2226) 2022-10-02 18:31:08 +08:00
UpgradeHelper.cs Make UpgradeHelper compliant with .NET RID catalog 2023-03-29 20:15:22 +08:00