pub struct CarvingContext<'a, N: DimensionNoises> {
pub min_y: i32,
pub gen_depth: i32,
pub surface_system: &'a SurfaceSystem,
pub aquifer: &'a mut Aquifer<N>,
pub default_block_id: BlockStateId,
pub psl_corners: PreliminarySurfaceCorners,
pub chunk_min_x: i32,
pub chunk_min_z: i32,
}Expand description
Runtime context for a single apply_carvers invocation on one chunk.
Mirrors vanilla’s CarvingContext and borrows the Aquifer retained from Noise.
Fields§
§min_y: i32Dimension minimum Y (inclusive).
gen_depth: i32Dimension vertical extent in blocks (max_y = min_y + gen_depth - 1).
surface_system: &'a SurfaceSystemSurface system (biome-specific surface noise + clay bands).
aquifer: &'a mut Aquifer<N>Aquifer for this chunk, retained from Noise or reconstructed after a disk reload.
default_block_id: BlockStateIdDefault solid block for this dimension (stone / netherrack /
end_stone).
psl_corners: PreliminarySurfaceCornersPreliminary surface levels at the 4 corners of this chunk, used for
bilinear interpolation of min_surface_level during top-material
lookup.
chunk_min_x: i32Chunk NW block X — anchors psl_corners.
chunk_min_z: i32Chunk NW block Z — anchors psl_corners.
Implementations§
Source§impl<N: DimensionNoises> CarvingContext<'_, N>
impl<N: DimensionNoises> CarvingContext<'_, N>
Sourcepub fn min_surface_level(&self, block_x: i32, block_z: i32) -> i32
pub fn min_surface_level(&self, block_x: i32, block_z: i32) -> i32
Bilinear interpolation of the 4 preliminary-surface-level corners at
the given in-chunk position. Matches vanilla’s
SurfaceRules.Context.updateXZ path.
Sourcepub fn top_material(
&self,
biome_id: u16,
block_x: i32,
block_y: i32,
block_z: i32,
steep: bool,
under_fluid: bool,
) -> Option<BlockStateId>
pub fn top_material( &self, biome_id: u16, block_x: i32, block_y: i32, block_z: i32, steep: bool, under_fluid: bool, ) -> Option<BlockStateId>
Runs surface rules at a single position to pick the “top material” block (grass / podzol / mycelium / sand / …). Called by the carver when it uncovers dirt beneath a grass block so the exposed surface gets rewritten to the biome-appropriate surface block.
Mirrors vanilla’s SurfaceSystem.topMaterial (the @Deprecated
carver-specific variant). Vanilla hardcodes
stone_depth_above = stone_depth_below = 1 here, and the water height
depends on whether the carved block was replaced with a fluid.
Auto Trait Implementations§
impl<'a, N> !UnwindSafe for CarvingContext<'a, N>
impl<'a, N> Freeze for CarvingContext<'a, N>
impl<'a, N> RefUnwindSafe for CarvingContext<'a, N>
impl<'a, N> Send for CarvingContext<'a, N>
impl<'a, N> Sync for CarvingContext<'a, N>
impl<'a, N> Unpin for CarvingContext<'a, N>
impl<'a, N> UnsafeUnpin for CarvingContext<'a, N>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreArc<SyncMutex<>>