Skip to main content

FlatGenerationContext

Struct FlatGenerationContext 

Source
struct FlatGenerationContext<'a> {
Show 15 fields seed: i64, chunk_x: i32, chunk_z: i32, chunk_min_x: i32, chunk_min_z: i32, center_block_x: i32, center_block_z: i32, sea_level: i32, min_y: i32, height: i32, layers: &'a [BlockStateId], biome: BiomeRef, template_pools: &'a FxHashMap<Identifier, TemplatePoolData>, templates: &'a FxHashMap<Identifier, TemplateData>, surface_y_cache: Option<i32>,
}

Fields§

§seed: i64§chunk_x: i32§chunk_z: i32§chunk_min_x: i32§chunk_min_z: i32§center_block_x: i32§center_block_z: i32§sea_level: i32§min_y: i32§height: i32§layers: &'a [BlockStateId]§biome: BiomeRef§template_pools: &'a FxHashMap<Identifier, TemplatePoolData>§templates: &'a FxHashMap<Identifier, TemplateData>§surface_y_cache: Option<i32>

Implementations§

Source§

impl FlatGenerationContext<'_>

Source

fn state_at_y(&self, y: i32) -> Option<BlockStateId>

Source

fn is_opaque_at_y(&self, y: i32, ocean_floor: bool) -> bool

Source

fn base_height_flat(&self, ocean_floor: bool) -> i32

Trait Implementations§

Source§

impl StructureGenerationContext for FlatGenerationContext<'_>

Source§

fn seed(&self) -> i64

World seed.
Source§

fn chunk_x(&self) -> i32

Chunk X being populated.
Source§

fn chunk_z(&self) -> i32

Chunk Z being populated.
Source§

fn chunk_min_x(&self) -> i32

Minimum block X of the chunk.
Source§

fn chunk_min_z(&self) -> i32

Minimum block Z of the chunk.
Source§

fn center_block_x(&self) -> i32

Center block X of the chunk.
Source§

fn center_block_z(&self) -> i32

Center block Z of the chunk.
Source§

fn sea_level(&self) -> i32

Sea level for this generator/dimension.
Source§

fn min_y(&self) -> i32

Minimum build Y.
Source§

fn height(&self) -> i32

Total build height.
Source§

fn template_pools(&self) -> &FxHashMap<Identifier, TemplatePoolData>

Template pool registry for jigsaw assembly.
Source§

fn templates(&self) -> &FxHashMap<Identifier, TemplateData>

Structure templates (piece definitions + sizes).
Source§

fn base_height(&mut self, _x: i32, _z: i32, ocean_floor: bool) -> i32

Base height at a column.
Source§

fn base_height_full(&mut self, _x: i32, _z: i32, ocean_floor: bool) -> i32

Full-column base height scan.
Source§

fn biome_at(&mut self, _block_x: i32, _block_y: i32, _block_z: i32) -> BiomeRef

Biome at a block position.
Source§

fn column_state(&mut self, _x: i32, y: i32, _z: i32) -> ColumnBlock

Classify a block in the generator’s base terrain.
Source§

fn surface_y(&mut self) -> i32

Chunk-center surface Y, memoised by the concrete context.
Source§

fn terrain_surface_height(&self, _x: i32, _z: i32, ocean_floor: bool) -> i32

Surface height for off-chunk terrain queries used by piece placement.
Source§

fn terrain_is_opaque(&self, _x: i32, y: i32, _z: i32, ocean_floor: bool) -> bool

Opaque terrain test for off-chunk terrain queries used by piece placement.
Source§

fn max_y(&self) -> i32

One-past-maximum build Y.
Source§

fn solid_block_below_air( &mut self, x: i32, z: i32, start_y: i32, min_solid_y: i32, ) -> Option<i32>

Highest solid base-terrain block directly below air in [min_solid_y, start_y).

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

impl<T> IntoShared for T

Source§

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
§

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

§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] only if self and other return Action::Follow. Read more
§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] if either self or other returns Action::Follow. 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