Skip to main content

BiomeSourceKind

Enum BiomeSourceKind 

Source
#[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
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

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

Source

pub fn overworld(seed: u64) -> Self

Create an overworld biome source with the given world seed.

Source

pub fn nether(seed: u64) -> Self

Create a nether biome source with the given world seed.

Source

pub fn end(seed: u64) -> Self

Create an end biome source with the given world seed.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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

Source§

fn possible_biomes(&self) -> FxHashSet<Identifier>

Every biome this provider can produce.
Source§

fn ring_position_cache_key(&self) -> Option<String>

Stable identity for every provider input that can affect ring snapping. Read more
Source§

fn find_biome_horizontal( &self, origin_x: i32, origin_z: i32, search_radius: i32, allowed: &dyn Fn(&Identifier) -> bool, rng: &mut LegacyRandom, ) -> Option<(i32, i32)>

Vanilla’s BiomeSource.findBiomeHorizontal(findClosest=false, skipSteps=1).

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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 more
§

impl<T> IntoShared for T

§

fn into_shared(self) -> Arc<Mutex<RawMutex, Self>>

Wraps this value in an Arc<SyncMutex<>>
§

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more