RegionIO/cmd
Master290 0a2845fa76 Fix the bedrock floor ramp and add a gendump check for it
bedrockAt had two bugs that cancelled into a deterministic, wrong-looking floor.

It took its chunkRand by value, so next() mutated a copy and all four layers
drew the same 32-bit number. The layers were then decided by successive bits of
that one draw, nesting them into a prefix condition instead of scattering them
independently.

Its ramp also ran backwards. The comment claimed d=1 -> 50% decaying upward, but
`keep := 5 - d` requires more bits set the *lower* the layer, giving 1/16 at the
floor and 1/2 four blocks up — bedrock was likelier further from the bottom.
Vanilla ramps probability linearly from 1 at y=-64 to 0 at y=-59 and tests
nextFloat() < probability, which is what it does now.

Only fillLegacySurface reaches this; the normal path lets the surface rule tree
place the floor from the same datapack vertical_gradient rule. Both should agree.

cmd/gendump is new here: a client-free diagnostic that reports biome
distribution, top surface blocks, subsurface banding, deep-layer composition and
an ASCII cross-section, so generator defects can be seen without launching a
client. Its bedrock-band check prints per-layer counts and fails on any air or
water in the floor. On chunk (0,0) at seed 12345 it now reports y=-64 fully
bedrock, 207/154/106/66 thinning above it, and zero air or water.

The same output also shows the missing subsurface banding — grass sits directly
on stone — which is a separate defect in above_preliminary_surface, not fixed
here.
2026-07-27 01:28:04 +03:00
..
genblocks Add StructureManager and NBT template loader for large structures 2026-06-27 21:28:11 +03:00
gendump Fix the bedrock floor ramp and add a gendump check for it 2026-07-27 01:28:04 +03:00
genlight Add dynamic chunk lighting engine (vertical sky light + emissive blocks) 2026-06-27 21:21:31 +03:00
regionio Fix terrain streaming and surface spawning 2026-07-21 11:11:19 +03:00