RegionIO/internal/world
Master290 c399070f59 Write biome palettes in the form the client actually reads
Vanilla's SECTION_BIOMES palette strategy switches on the bit count with
`tableswitch {0..3}`: 0 single-valued, 1-3 linear, and everything else falls
through to the global palette. There is no hashmap tier for biomes — that exists
only for block states, whose 0..8 switch we already implement correctly.

We were writing a linear palette all the way up to 7 bits. A section holding 9 or
more distinct biomes therefore went out as a 4-bit indirect container while the
client read it as global: no palette prefix consumed, long array re-read at 7
bits, and every field after it in the chunk payload misaligned. Sections that
straddle the surface and the cave biomes really do carry that many, so this is
reachable in ordinary terrain rather than a corner case.

Checked against the jar rather than recalled: javap -c on Strategy$2 shows the
{0..3} switch with Configuration$Global in the default arm.

The test decodes each container the way the client would and requires it to
consume exactly the bytes we produced, so a misframed container shows up as a
byte count instead of needing a client to notice. Restoring the old threshold
fails the 9-, 20- and 65-biome cases.
2026-07-27 01:28:04 +03:00
..
testdata Implement multiplayer persistence and vanilla lighting 2026-07-21 09:21:44 +03:00
bench_test.go Initial commit: RegionIO Minecraft server core (26.1.2/protocol 775) 2026-06-24 00:32:51 +03:00
biome_3d_test.go 3D per-cell biomes (4x4x4) with surface/underground/cave layers 2026-06-24 01:04:01 +03:00
biome_bench_test.go 3D per-cell biomes (4x4x4) with surface/underground/cave layers 2026-06-24 01:04:01 +03:00
biome_lookup.go Biome-aware surface rules from the vanilla rule tree 2026-06-24 19:44:07 +03:00
biome_lookup_test.go 3D per-cell biomes (4x4x4) with surface/underground/cave layers 2026-06-24 01:04:01 +03:00
biome_parameters.json Initial commit: RegionIO Minecraft server core (26.1.2/protocol 775) 2026-06-24 00:32:51 +03:00
blocks.json Chunk persistence to Anvil .mca region files 2026-06-25 00:40:14 +03:00
cache.go Fix terrain streaming and surface spawning 2026-07-21 11:11:19 +03:00
cache_light.go Fix terrain streaming and surface spawning 2026-07-21 11:11:19 +03:00
cache_light_reuse_test.go Fix terrain streaming and surface spawning 2026-07-21 11:11:19 +03:00
cache_test.go Implement multiplayer persistence and vanilla lighting 2026-07-21 09:21:44 +03:00
cache_tickets.go Implement ticketed chunk lifecycle 2026-07-21 10:04:56 +03:00
cache_tickets_test.go Implement ticketed chunk lifecycle 2026-07-21 10:04:56 +03:00
chunk.go Implement multiplayer persistence and vanilla lighting 2026-07-21 09:21:44 +03:00
compress.go Implement multiplayer persistence and vanilla lighting 2026-07-21 09:21:44 +03:00
encode.go Write biome palettes in the form the client actually reads 2026-07-27 01:28:04 +03:00
encode_test.go Write biome palettes in the form the client actually reads 2026-07-27 01:28:04 +03:00
entity.go Implement multiplayer persistence and vanilla lighting 2026-07-21 09:21:44 +03:00
features.go Implement multiplayer persistence and vanilla lighting 2026-07-21 09:21:44 +03:00
golden_test.go Implement multiplayer persistence and vanilla lighting 2026-07-21 09:21:44 +03:00
item_blocks.json Initial commit: RegionIO Minecraft server core (26.1.2/protocol 775) 2026-06-24 00:32:51 +03:00
items.go Initial commit: RegionIO Minecraft server core (26.1.2/protocol 775) 2026-06-24 00:32:51 +03:00
light.go Implement ticketed chunk lifecycle 2026-07-21 10:04:56 +03:00
light_properties.bin Implement multiplayer persistence and vanilla lighting 2026-07-21 09:21:44 +03:00
light_properties.go Implement multiplayer persistence and vanilla lighting 2026-07-21 09:21:44 +03:00
light_test.go Implement multiplayer persistence and vanilla lighting 2026-07-21 09:21:44 +03:00
regionfile.go Implement multiplayer persistence and vanilla lighting 2026-07-21 09:21:44 +03:00
spawn_surface_test.go Fix terrain streaming and surface spawning 2026-07-21 11:11:19 +03:00
state_names.go Fix terrain streaming and surface spawning 2026-07-21 11:11:19 +03:00
store.go Implement multiplayer persistence and vanilla lighting 2026-07-21 09:21:44 +03:00
store_test.go Implement ticketed chunk lifecycle 2026-07-21 10:04:56 +03:00
surface_verify_test.go Biome-aware surface rules from the vanilla rule tree 2026-06-24 19:44:07 +03:00
terrain.go Implement multiplayer persistence and vanilla lighting 2026-07-21 09:21:44 +03:00
terrain_bench_test.go Initial commit: RegionIO Minecraft server core (26.1.2/protocol 775) 2026-06-24 00:32:51 +03:00
terrain_debug_test.go Initial commit: RegionIO Minecraft server core (26.1.2/protocol 775) 2026-06-24 00:32:51 +03:00
vanilla.go Implement multiplayer persistence and vanilla lighting 2026-07-21 09:21:44 +03:00
vanilla_bench_test.go Initial commit: RegionIO Minecraft server core (26.1.2/protocol 775) 2026-06-24 00:32:51 +03:00
vanilla_parity_test.go Initial commit: RegionIO Minecraft server core (26.1.2/protocol 775) 2026-06-24 00:32:51 +03:00