Expand description
Noise-based aquifer system for underground fluid placement.
Matches vanillaβs Aquifer.NoiseBasedAquifer. Divides the world into a
16Γ12Γ16 grid of aquifer cells, each with a randomly-jittered center point.
For each non-solid block, finds the 4 nearest aquifer centers and computes
fluid status (water vs lava, surface level) based on noise functions.
Barrier pressure between neighboring aquifer cells creates solid rock
walls between fluid pockets.
StructsΒ§
- Aquifer
- Noise-based aquifer for a single chunk.
- Aquifer
Column πCache - Column-scan state for the 12 aquifer-neighborhood cells, stored
SoAso the per-Y distance computation can be SIMD-batched as 3Γi32x4. - Fluid
Status π - Fluid status at an aquifer cell center.
- Lazy
Aquifer - Deferred
Aquifer. Used bycreate_structuresso chunks where no structure queries the aquifer skip its (expensive)max_preliminary_surface_levelscan.
EnumsΒ§
- Aquifer
Result - Result of the aquifer substance check.
ConstantsΒ§
- FLOWING_
UPDATE_ πSIMILARITY - LAVA_
LEVEL π - PACKED_
X_ πMASK - PACKED_
Y_ πMASK - PACKED_
Z_ πMASK - SAMPLE_
OFFSET_ πX - SAMPLE_
OFFSET_ πY - SAMPLE_
OFFSET_ πZ - SURFACE_
SAMPLING_ πOFFSETS - Chunk offsets (in chunks, Γ16 for blocks) used when sampling preliminary surface levels around an aquifer cell center.
- WAY_
BELOW_ πMIN_ Y - Sentinel for βno fluidβ β well below any real Y coordinate.
- X_
OFFSET π - X_RANGE π
- Y_RANGE π
- Y_
SPACING π - Z_
OFFSET π - Z_RANGE π
FunctionsΒ§
- cached_
preliminary_ πsurface_ level preliminary_surface_levelwith a per-quart-column result cache (vanillaβsLong2IntMap). On a hit it returns the memoizedi32and skips the expensive flat-router recompute incache.ensure. Bit-identical: the cached value is the same deterministic function of the quart column.- from_
grid_ πx - from_
grid_ πy - from_
grid_ πz - global_
fluid π - Global fluid picker matching vanillaβs
NoiseBasedChunkGenerator.createFluidPicker. - grid_x π
- grid_y π
- grid_z π
- is_
deep_ πdark_ region - Deep dark region check matching
OverworldBiomeBuilder.isDeepDarkRegion. - pack_
pos π - preliminary_
surface_ level - Evaluate preliminary surface level at quart-quantized coordinates.
- quantize π
- Quantize: snap value down to the nearest multiple of
quantum. - similarity π
- Similarity between two squared distances. Positive when the two nearest aquifer cells are close together (near a boundary).
- unpack_
x π - unpack_
y π - unpack_
z π