Added pre 1.18 surface terrain functions - #34
Open
Colin-Henry wants to merge 45 commits into
Open
Conversation
…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)
Experimental
…+ y-level adjustment support
Stronghold loot
Lookup table (& debug)
Stronghold loot
Moved dungeon logic out of stronghold.c and into dungeon.c Added/fixed dungeon loot tables
… and is significantly faster)
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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