Skip to main content

Module aquifer

Module aquifer 

Source
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.
AquiferColumnCache πŸ”’
Column-scan state for the 12 aquifer-neighborhood cells, stored SoA so the per-Y distance computation can be SIMD-batched as 3Γ— i32x4.
FluidStatus πŸ”’
Fluid status at an aquifer cell center.
LazyAquifer
Deferred Aquifer. Used by create_structures so chunks where no structure queries the aquifer skip its (expensive) max_preliminary_surface_level scan.

EnumsΒ§

AquiferResult
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_level with a per-quart-column result cache (vanilla’s Long2IntMap). On a hit it returns the memoized i32 and skips the expensive flat-router recompute in cache.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 πŸ”’