pub struct StructureStart {
pub structure: Identifier,
pub chunk_pos: ChunkPos,
pub references: i32,
pub pieces: Vec<StructurePiece>,
pub bb_inflate: i32,
pub terrain_adjustment: TerrainAdjustment,
pub bounding_box: Option<BoundingBox>,
}Expand description
A structure start placed in a chunk. Vanilla’s StructureStart — invalid (empty)
starts are not stored.
Fields§
§structure: IdentifierStructure id (e.g., minecraft:village).
chunk_pos: ChunkPosOrigin chunk.
references: i32Vanilla’s map/locate reference counter. This is distinct from
StructureReferenceMap; generating per-chunk structure references does
not increment this counter.
pieces: Vec<StructurePiece>Pieces composing this structure.
bb_inflate: i32Bounding-box inflation applied at construction. Vanilla inflates by 12
when terrain_adaptation != NONE. Stored for serialization parity; the
inflation is already baked into bounding_box.
terrain_adjustment: TerrainAdjustmentTerrain adaptation mode from the structure registry. Used by Beardifier.
bounding_box: Option<BoundingBox>Cached bounding box matching vanilla’s StructureStart.getBoundingBox():
the union of piece bounding boxes, then inflatedBy(bb_inflate).
None iff pieces is empty.
Implementations§
Source§impl StructureStart
impl StructureStart
Sourcepub fn new(
structure: Identifier,
chunk_pos: ChunkPos,
pieces: Vec<StructurePiece>,
terrain_adjustment: TerrainAdjustment,
) -> Self
pub fn new( structure: Identifier, chunk_pos: ChunkPos, pieces: Vec<StructurePiece>, terrain_adjustment: TerrainAdjustment, ) -> Self
Creates a start, computing the inflated piece-union bounding box up-front.
Sourcepub fn compute_bounding_box(
pieces: &[StructurePiece],
bb_inflate: i32,
) -> Option<BoundingBox>
pub fn compute_bounding_box( pieces: &[StructurePiece], bb_inflate: i32, ) -> Option<BoundingBox>
Union of all pieces’ bounding boxes, inflated by bb_inflate on every
axis. Returns None if pieces is empty. Mirrors vanilla’s
StructureStart.getBoundingBox() (= adjustBoundingBox(union)).
Sourcepub fn placement_reference_pos(&self) -> Option<BlockPos>
pub fn placement_reference_pos(&self) -> Option<BlockPos>
Vanilla StructureStart.placeInChunk reference position: the first
piece center X/Z and first piece minimum Y.
Trait Implementations§
Source§impl Clone for StructureStart
impl Clone for StructureStart
Source§fn clone(&self) -> StructureStart
fn clone(&self) -> StructureStart
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for StructureStart
impl RefUnwindSafe for StructureStart
impl Send for StructureStart
impl Sync for StructureStart
impl Unpin for StructureStart
impl UnsafeUnpin for StructureStart
impl UnwindSafe for StructureStart
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
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> ⓘ
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<>>