#[non_exhaustive]pub enum BiomeSourceKind {
Overworld(OverworldBiomeSource),
Nether(NetherBiomeSource),
End(Box<EndBiomeSource>),
}Expand description
Dimension-specific biome source.
Each variant holds shared state (noise generators, parameter lists) and
creates per-chunk samplers via chunk_sampler.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Overworld(OverworldBiomeSource)
Overworld biome source (multi-noise climate matching).
Nether(NetherBiomeSource)
Nether biome source (multi-noise temperature/vegetation matching).
End(Box<EndBiomeSource>)
End biome source (spatial distance + erosion threshold).
Boxed because EndIslands is ~2KB (simplex noise permutation table),
while the other variants are pointer-sized.
Implementations§
Source§impl BiomeSourceKind
impl BiomeSourceKind
Sourcepub fn overworld(seed: u64) -> Self
pub fn overworld(seed: u64) -> Self
Create an overworld biome source with the given world seed.
Sourcepub fn possible_biome_refs(&self) -> Vec<BiomeRef> ⓘ
pub fn possible_biome_refs(&self) -> Vec<BiomeRef> ⓘ
Every biome this source can produce, preserving the source’s parameter-list order.
Feature sorting depends on biome iteration order because vanilla assigns global
feature order while walking all possible biomes. The set-returning
possible_biomes is kept for callers that only need
membership tests.
Sourcepub fn possible_biomes(&self) -> FxHashSet<Identifier>
pub fn possible_biomes(&self) -> FxHashSet<Identifier>
Every biome this source can produce. Used to filter structure sets whose
resolved allowed_biomes are from a different dimension.
Sourcepub fn chunk_sampler(&self) -> ChunkBiomeSampler<'_>
pub fn chunk_sampler(&self) -> ChunkBiomeSampler<'_>
Create a per-chunk biome sampler.
The returned sampler holds per-chunk caches and should be dropped after the chunk’s biomes are fully populated.
Sourcepub fn find_biome_horizontal(
&self,
origin_x: i32,
origin_z: i32,
search_radius: i32,
allowed: &dyn Fn(BiomeRef) -> bool,
rng: &mut LegacyRandom,
) -> Option<(i32, i32)>
pub fn find_biome_horizontal( &self, origin_x: i32, origin_z: i32, search_radius: i32, allowed: &dyn Fn(BiomeRef) -> bool, rng: &mut LegacyRandom, ) -> Option<(i32, i32)>
Vanilla’s BiomeSource.findBiomeHorizontal(findClosest=false, skipSteps=1).
Reservoir-samples at y=0. Returns Some((block_x, block_z)) if found.
Sourcepub fn initial_spawn_search_origin(&self) -> BlockPos
pub fn initial_spawn_search_origin(&self) -> BlockPos
Returns vanilla’s climate-based initial spawn search origin for dimensions that define one.
Trait Implementations§
Source§impl StructureBiomeProvider for BiomeSourceKind
impl StructureBiomeProvider for BiomeSourceKind
Source§fn possible_biomes(&self) -> FxHashSet<Identifier>
fn possible_biomes(&self) -> FxHashSet<Identifier>
Auto Trait Implementations§
impl Freeze for BiomeSourceKind
impl RefUnwindSafe for BiomeSourceKind
impl Send for BiomeSourceKind
impl Sync for BiomeSourceKind
impl Unpin for BiomeSourceKind
impl UnsafeUnpin for BiomeSourceKind
impl UnwindSafe for BiomeSourceKind
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<>>