Minecraft-Console-Client/MinecraftClient/Protocol/Handlers
BruceChen 067395ab2a fix: correct biome data array length calculation for 1.21.5+ terrain parsing
The biome PalettedContainer data array length was calculated as
ceil(64 * bitsPerEntry / 64) which is incorrect for non-power-of-2
bit widths. The correct calculation uses SimpleBitStorage's formula:
valuesPerLong = 64 / bitsPerEntry, then ceil(64 / valuesPerLong).

For example, with bitsPerEntry=3: old formula gave 3 longs but the
actual data contains 4 longs (valuesPerLong=21, ceil(64/21)=4).

This bug was masked in 1.21.5 by excess padding bytes in chunk buffers
(due to PalettedContainer.Data.getSerializedSize over-counting). MC
1.21.6 fixed the size calculation server-side, removing the padding
and exposing this pre-existing MCC bug.

Made-with: Cursor
2026-03-21 12:11:18 +08:00
..
Forge refactor(ForgeInfo.cs): Remove unused code and edit comments 2024-02-20 22:02:22 +08:00
Packet/s2c Preliminary 1.21 Support 2024-12-06 16:45:48 +01:00
PacketPalettes feat: add palettes and version routing for MC 1.21.6 2026-03-21 11:44:12 +08:00
StructuredComponents feat: add MC 1.21.5 (protocol 770) support 2026-03-21 00:48:27 +08:00
ConfigurationPacketTypesIn.cs feat: add MC 1.21.6 (protocol 771) version constants and enum values 2026-03-21 11:34:20 +08:00
ConfigurationPacketTypesOut.cs feat: add MC 1.21.6 (protocol 771) version constants and enum values 2026-03-21 11:34:20 +08:00
DataTypes.cs feat: add MC 1.21.5 (protocol 770) support 2026-03-21 00:48:27 +08:00
PacketType18Handler.cs feat: add palettes and version routing for MC 1.21.6 2026-03-21 11:44:12 +08:00
PacketTypesIn.cs feat: add MC 1.21.6 (protocol 771) version constants and enum values 2026-03-21 11:34:20 +08:00
PacketTypesOut.cs feat: add MC 1.21.6 (protocol 771) version constants and enum values 2026-03-21 11:34:20 +08:00
Protocol16.cs 1.20.6 - Not working yet 2024-06-16 01:19:09 +02:00
Protocol18.cs feat: add palettes and version routing for MC 1.21.6 2026-03-21 11:44:12 +08:00
Protocol18Forge.cs fix(Protocol18Forge.cs): Version bigger or equal 1.18 is FML3 2024-02-20 22:23:46 +08:00
Protocol18Terrain.cs fix: correct biome data array length calculation for 1.21.5+ terrain parsing 2026-03-21 12:11:18 +08:00
SocketWrapper.cs First Version of Structured Components 2024-09-01 20:42:39 +02:00
ZlibUtils.cs Fix all warnings & Trim (#2226) 2022-10-02 18:31:08 +08:00