mirror of
https://github.com/MCCTeam/Minecraft-Console-Client
synced 2026-08-15 13:04:36 +00:00
The JoinGame and Respawn packet handlers for 1.20.6+ used hardcoded switch expressions to map dimension type VarInt IDs to names: 0 => overworld, 1 => overworld_caves, 2 => the_end, 3 => the_nether This only works for vanilla servers with exactly 4 default dimensions. Modded servers (Forge/Fabric/NeoForge) or servers with custom datapacks can register additional dimensions with IDs beyond 0-3, causing the switch to fall through to the default "overworld" for any non-vanilla dimension. This means players in modded dimensions would have incorrect world parameters (height, lighting, etc.). Fix: Replace both hardcoded switch expressions with World.GetDimensionNameById(), which looks up the VarInt ID in the dimension ID map populated during the RegistryData phase. Also fixes two pre-existing issues in the SetDimension dispatch: - JoinGame (pre-1.20.2 path): The `case < MC_1_20_6_Version` guard was technically correct within its enclosing `if` block, but changed to `default` for clarity and future-proofing. - Respawn: The `case <= MC_1_20_6_Version` guard excluded protocol versions above 766 (e.g. 1.21 / protocol 767), meaning SetDimension was never called for those versions. Changed to `default` so all versions >= 1.19 properly update the dimension. Made-with: Cursor |
||
|---|---|---|
| .. | ||
| Forge | ||
| Packet/s2c | ||
| PacketPalettes | ||
| StructuredComponents | ||
| ConfigurationPacketTypesIn.cs | ||
| ConfigurationPacketTypesOut.cs | ||
| DataTypes.cs | ||
| PacketType18Handler.cs | ||
| PacketTypesIn.cs | ||
| PacketTypesOut.cs | ||
| Protocol16.cs | ||
| Protocol18.cs | ||
| Protocol18Forge.cs | ||
| Protocol18Terrain.cs | ||
| SocketWrapper.cs | ||
| ZlibUtils.cs | ||