pub struct CarveRun<'a, 'b, N, F>{
pub ctx: &'a mut CarvingContext<'b, N>,
pub noises: &'a N,
pub chunk: GenerationChunk<'a, CarversPhase>,
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, CarversPhase>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 the chunk (lazily created on the proto chunk).
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.
Sourcefn do_carve_canyon(
&mut self,
params: &CarveParams<'_>,
config: &CanyonCarverConfiguration,
state: CanyonState,
tunnel: CanyonTunnel,
)
fn do_carve_canyon( &mut self, params: &CarveParams<'_>, config: &CanyonCarverConfiguration, state: CanyonState, tunnel: CanyonTunnel, )
Vanilla CanyonWorldCarver.doCarve.
Source§impl<N, F> CarveRun<'_, '_, N, F>
impl<N, F> CarveRun<'_, '_, N, F>
Sourcepub fn carve_cave(
&mut self,
config: &CaveCarverConfiguration,
kind: CaveKind,
source_pos: ChunkPos,
random: &mut LegacyRandom,
)
pub fn carve_cave( &mut self, config: &CaveCarverConfiguration, kind: CaveKind, 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 / NetherWorldCarver.carve
(which inherits the cave variant).
Sourcefn create_room<S: CarveSkipChecker>(
&mut self,
params: &CarveParams<'_>,
x: f64,
y: f64,
z: f64,
thickness: f32,
y_scale: f64,
skip_checker: S,
)
fn create_room<S: CarveSkipChecker>( &mut self, params: &CarveParams<'_>, 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,
params: &CarveParams<'_>,
state: TunnelState,
tunnel: TunnelParams,
skip_checker: S,
)where
S: CarveSkipChecker + Copy,
fn create_tunnel<S>(
&mut self,
params: &CarveParams<'_>,
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,
params: &CarveParams<'_>,
x: f64,
y: f64,
z: f64,
horizontal_radius: f64,
vertical_radius: f64,
skip_checker: S,
) -> bool
pub fn carve_ellipsoid<S: CarveSkipChecker>( &mut self, params: &CarveParams<'_>, 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.
Mirrors vanilla’s WorldCarver.carveEllipsoid.
Returns true if at least one block was carved.
Sourcefn carve_block(
&mut self,
params: &CarveParams<'_>,
world_x: i32,
world_y: i32,
world_z: i32,
has_grass: &mut bool,
) -> bool
fn carve_block( &mut self, params: &CarveParams<'_>, world_x: i32, world_y: i32, world_z: i32, has_grass: &mut bool, ) -> bool
Per-block carve decision + placement. Mirrors vanilla’s
WorldCarver.carveBlock (and the NetherWorldCarver override).
fn can_replace(params: &CarveParams<'_>, state: BlockStateId) -> bool
fn steep_material_condition(&self, world_x: i32, world_z: i32) -> bool
Sourcefn get_carve_state(
&mut self,
params: &CarveParams<'_>,
x: i32,
y: i32,
z: i32,
) -> CarveState
fn get_carve_state( &mut self, params: &CarveParams<'_>, x: i32, y: i32, z: i32, ) -> CarveState
Vanilla’s WorldCarver.getCarveState + the nether override dispatch.
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>where
F: Send,
impl<'a, 'b, N, F> Sync for CarveRun<'a, 'b, N, F>where
F: Sync,
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<>>