pub struct StructurePlacement {
pub salt: i32,
pub frequency: f32,
pub frequency_reduction_method: FrequencyReductionMethod,
pub exclusion_zone: Option<ExclusionZone>,
pub locate_offset: IVec3,
pub kind: PlacementKind,
}Expand description
Structure placement configuration.
Fields§
§salt: i32Unique seed modifier.
frequency: f32Probability of generating on a placement-chunk. 1.0 = always.
frequency_reduction_method: FrequencyReductionMethodFrequency-reduction method.
exclusion_zone: Option<ExclusionZone>Optional exclusion zone against another structure set.
locate_offset: IVec3Block offset from the placement chunk used by /locate.
kind: PlacementKindKind-specific parameters.
Implementations§
Source§impl StructurePlacement
impl StructurePlacement
Sourcepub const fn locate_pos(&self, chunk_pos: ChunkPos) -> BlockPos
pub const fn locate_pos(&self, chunk_pos: ChunkPos) -> BlockPos
Locate result block position for a valid placement chunk.
Sourcepub fn is_structure_chunk(
&self,
seed: i64,
source_x: i32,
source_z: i32,
ring_positions: Option<&[ChunkPos]>,
) -> bool
pub fn is_structure_chunk( &self, seed: i64, source_x: i32, source_z: i32, ring_positions: Option<&[ChunkPos]>, ) -> bool
Valid placement chunk + frequency check. For ConcentricRings,
ring_positions must be pre-computed.
fn is_placement_chunk( &self, seed: i64, source_x: i32, source_z: i32, ring_positions: Option<&[ChunkPos]>, ) -> bool
Sourcepub fn get_potential_structure_chunk(
seed: i64,
salt: i32,
source_x: i32,
source_z: i32,
spacing: i32,
separation: i32,
spread_type: SpreadType,
) -> ChunkPos
pub fn get_potential_structure_chunk( seed: i64, salt: i32, source_x: i32, source_z: i32, spacing: i32, separation: i32, spread_type: SpreadType, ) -> ChunkPos
Deterministic structure chunk for the grid cell containing (source_x, source_z).
Trait Implementations§
Source§impl Clone for StructurePlacement
impl Clone for StructurePlacement
Source§fn clone(&self) -> StructurePlacement
fn clone(&self) -> StructurePlacement
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for StructurePlacement
impl RefUnwindSafe for StructurePlacement
impl Send for StructurePlacement
impl Sync for StructurePlacement
impl Unpin for StructurePlacement
impl UnsafeUnpin for StructurePlacement
impl UnwindSafe for StructurePlacement
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§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> ⓘ
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 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> ⓘ
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 moreWraps this value in an
Arc<SyncMutex<>>