RegionIO/internal/world
Master290 21a10ab65e Implement the vanilla Aquifer; stop flooding caves
Every air block below y=63 was turned into water. That is one line of code and
it cost the entire underground: no dry caves, no lava lakes, no air pockets, a
solid block of water from the sea floor to bedrock.

Vanilla decides fluid per position instead. Aquifer centres sit on a jittered
16x12x16 grid; each gets a fluid level and type from the floodedness and spread
noises, with centres near open sky inheriting the sea and buried ones getting a
much lower randomised level or nothing at all. A position takes its nearest
centre's fluid unless the barrier noise raises enough pressure between the two
or three nearest centres to seal it back to stone. Deep centres turn to lava.

Porting it means fixing the order of generation, not just adding a file. Vanilla
resolves stone/water/lava/air during the density pass and only then runs the
surface rules over a finished column; we did it the other way round, which is
what forced the unconditional flood in the first place. fillVanillaColumn now
asks the aquifer per position, and applySurfaceRule walks the finished column
carrying the bookkeeping SurfaceSystem carries: air resets the counters, a fluid
records its water height, and stone gets a depth from the top of its run plus
one from the bottom, found by looking ahead to the next non-stone block below.

That last one fixes stone_depth's ceiling form, which had no bottom-up depth to
work with and was testing the top-down one instead -- fourteen rules in the
overworld tree use it to dress cave roofs. The floor form is unchanged: vanilla
counts from 1 and compares against 1 + offset, we counted from 0 and compared
against offset.

The aquifer grid is built eagerly per chunk rather than lazily, because our
columns fill concurrently; every cell is a pure function of its grid coordinate
and every cell in the computed range gets consulted anyway. Cost is ~0.5% of
chunk generation, most of it absorbed by the shared preliminary-surface cache.

Inland caves go from 100% water to 3.8%, and lava exists for the first time.
cmd/gendump grows a census that would have failed loudly before, and
TestCavesAreDry guards it in the suite.
2026-07-27 02:02:12 +03:00
..
testdata Implement multiplayer persistence and vanilla lighting 2026-07-21 09:21:44 +03:00
aquifer_verify_test.go Implement the vanilla Aquifer; stop flooding caves 2026-07-27 02:02:12 +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 Implement the vanilla Aquifer; stop flooding caves 2026-07-27 02:02:12 +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 the vanilla Aquifer; stop flooding caves 2026-07-27 02:02:12 +03:00
store_test.go Stop the saved world from masking generator changes 2026-07-27 01:28:05 +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 the vanilla Aquifer; stop flooding caves 2026-07-27 02:02:12 +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