Skip to content

Added pre 1.18 surface terrain functions - #34

Open
Colin-Henry wants to merge 45 commits into
xpple:masterfrom
Colin-Henry:surfaceTerrain
Open

Added pre 1.18 surface terrain functions#34
Colin-Henry wants to merge 45 commits into
xpple:masterfrom
Colin-Henry:surfaceTerrain

Conversation

@Colin-Henry

Copy link
Copy Markdown

Adds getSingleBlockSurfaceHeight, which finds the surface height at a single block for B1.8–1.17. It trilinearly interpolates the noise columns around that block and scans downward from y=151.
Rarely does terrain go above y=151 so this is for optimization. To finetune how far up it checks, adjust SURFACE_DENS_CELLS
The first block with density > 0 is solid, and the height returned is the free block above it (WORLD_SURFACE_WG).
With oceanFloor cleared the scan stops at y=63, since everything below sea level is water filled in automatically
Also returns -1 for incorrect dimension and/or version

Colin-Henry and others added 30 commits July 7, 2026 18:47
…arver bugs

Generator.c/.h:
-Added isNaturalWater (a more exact surface height detection used for mineshaft logic)
Finders.c/.h:
-Corrected all bugs in previous versions (including neighbor behavior). Carvers should be fully accurate now
-Updated applyAllCarvers to reflect both bugfixes and xpple's initial commit
Mineshaft.c/,.h:
-Fully accurate loot filtering
    -Calls to isNaturalWater are gated by optimized checks and caching to avoid excessive getBiomeAt calls
    -Carver water detection
    -Corrected bug with plank and rail placement (was advancing RNG differently)
Colin-Henry and others added 15 commits July 18, 2026 11:26
Moved dungeon logic out of stronghold.c and into dungeon.c
Added/fixed dungeon loot tables
The cache validated only the seed and the corner coordinates, so two
generators of different versions (or dimensions, or large biomes) that
share a seed would read each other's densities in the same process:
whichever one filled the slot first won.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant