pub struct CarveRun<'a, 'b, N, F>{
pub ctx: &'a mut CarvingContext<'b, N>,
pub noises: &'a N,
pub chunk: GenerationChunk<'a, TerrainPhase>,
pub chunk_min_x: i32,
pub chunk_min_z: i32,
pub biome_getter: &'a mut F,
pub mask: &'a mut CarvingMask,
pub ids: CarverBlockIds,
}Expand description
The references every carver method needs. Bundled so carve_ellipsoid,
carve_block, create_tunnel, create_room, carve_cave,
carve_canyon, and do_carve can all be &mut self methods instead of
repeating the same 7–8 arguments.
Fields§
§ctx: &'a mut CarvingContext<'b, N>Dimension-level context (aquifer, surface system, bounds, psl).
noises: &'a NNoise generators for this dimension.
chunk: GenerationChunk<'a, TerrainPhase>Chunk being carved into.
chunk_min_x: i32Chunk NW block X (cached; ctx.chunk_min_x mirrors this).
chunk_min_z: i32Chunk NW block Z (cached; ctx.chunk_min_z mirrors this).
biome_getter: &'a mut FBiome lookup (vanilla BiomeManager.getBiome-style, fuzzed).
mask: &'a mut CarvingMaskCarving mask for this Terrain operation.
ids: CarverBlockIdsBlock IDs cached once per carver session.
Implementations§
Source§impl<N, F> CarveRun<'_, '_, N, F>
impl<N, F> CarveRun<'_, '_, N, F>
Sourcepub fn carve_canyon(
&mut self,
config: &CanyonCarverConfiguration,
source_pos: ChunkPos,
random: &mut LegacyRandom,
)
pub fn carve_canyon( &mut self, config: &CanyonCarverConfiguration, source_pos: ChunkPos, random: &mut LegacyRandom, )
Runs a canyon carver pass rooted in source_pos. random must have
been seeded by the caller via
set_large_feature_seed(seed + carver_index, source.x, source.z)
and the isStartChunk probability check must have already passed.
Mirrors vanilla’s CanyonWorldCarver.carve — one tunnel per chunk,
no splits, no rooms.
fn do_carve_canyon( &mut self, config: &CanyonCarverConfiguration, state: CanyonState, tunnel: CanyonTunnel, )
Source§impl<N, F> CarveRun<'_, '_, N, F>
impl<N, F> CarveRun<'_, '_, N, F>
Sourcepub fn carve_cave(
&mut self,
config: &CaveCarverConfiguration,
source_pos: ChunkPos,
random: &mut LegacyRandom,
)
pub fn carve_cave( &mut self, config: &CaveCarverConfiguration, source_pos: ChunkPos, random: &mut LegacyRandom, )
Runs one cave-carver pass rooted in source_pos. random must have
been seeded by the caller via
LegacyRandom::set_large_feature_seed(seed + carver_index, cx, cz)
and the isStartChunk probability check must have already passed.
Mirrors vanilla’s CaveWorldCarver.carve.
Sourcefn create_room<S: CarveSkipChecker>(
&mut self,
x: f64,
y: f64,
z: f64,
thickness: f32,
y_scale: f64,
skip_checker: S,
)
fn create_room<S: CarveSkipChecker>( &mut self, x: f64, y: f64, z: f64, thickness: f32, y_scale: f64, skip_checker: S, )
Vanilla CaveWorldCarver.createRoom. Single ellipsoid at the tunnel
origin, offset by +1 on X.
Sourcefn create_tunnel<S>(
&mut self,
state: TunnelState,
tunnel: TunnelParams,
skip_checker: S,
)where
S: CarveSkipChecker + Copy,
fn create_tunnel<S>(
&mut self,
state: TunnelState,
tunnel: TunnelParams,
skip_checker: S,
)where
S: CarveSkipChecker + Copy,
Vanilla CaveWorldCarver.createTunnel. Steps along a curve, carving
an ellipsoid per step, with occasional mid-tunnel splits.
Source§impl<N, F> CarveRun<'_, '_, N, F>
impl<N, F> CarveRun<'_, '_, N, F>
Sourcepub fn carve_ellipsoid<S: CarveSkipChecker>(
&mut self,
x: f64,
y: f64,
z: f64,
horizontal_radius: f64,
vertical_radius: f64,
skip_checker: S,
) -> bool
pub fn carve_ellipsoid<S: CarveSkipChecker>( &mut self, x: f64, y: f64, z: f64, horizontal_radius: f64, vertical_radius: f64, skip_checker: S, ) -> bool
Carve every block inside the given ellipsoid that falls in this chunk.
Returns true if at least one block was carved.
Sourcepub fn apply_carving_mask(&mut self)
pub fn apply_carving_mask(&mut self)
Applies the shared output mask after every carver has marked its geometry.
fn steep_material_condition( chunk: GenerationChunk<'_, TerrainPhase>, world_x: i32, world_z: i32, ) -> bool
Source§impl<N, F> CarveRun<'_, '_, N, F>
impl<N, F> CarveRun<'_, '_, N, F>
Sourcefn run_all(
&mut self,
source_biomes: &[SourceChunk],
seed_i64: i64,
random: &mut LegacyRandom,
)
fn run_all( &mut self, source_biomes: &[SourceChunk], seed_i64: i64, random: &mut LegacyRandom, )
Drive the 17×17 source-chunk carver loop. Each carver in each source
biome is seeded via set_large_feature_seed, probability-checked,
then dispatched to the appropriate carve_* method.
Auto Trait Implementations§
impl<'a, 'b, N, F> !RefUnwindSafe for CarveRun<'a, 'b, N, F>
impl<'a, 'b, N, F> !UnwindSafe for CarveRun<'a, 'b, N, F>
impl<'a, 'b, N, F> Freeze for CarveRun<'a, 'b, N, F>
impl<'a, 'b, N, F> Send for CarveRun<'a, 'b, N, F>
impl<'a, 'b, N, F> Sync for CarveRun<'a, 'b, N, F>
impl<'a, 'b, N, F> Unpin for CarveRun<'a, 'b, N, F>
impl<'a, 'b, N, F> UnsafeUnpin for CarveRun<'a, 'b, N, F>
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<>>