Trait StructurePiece
pub trait StructurePiece:
Debug
+ Send
+ Sync {
// Required methods
fn bounding_box(&self) -> BoundingBox;
fn post_process(
&self,
context: &mut dyn PieceContext,
) -> Result<(), StructureError>;
fn add_additional_save_data(&self, tag: &mut BTreeMap<JavaString, Tag>);
}Expand description
One piece of a mod’s structure: vanilla’s StructurePiece. Its save is
the engine’s (StructurePiece.createTag: the type id, BB, O, GD)
around add_additional_save_data.
Required Methods§
fn bounding_box(&self) -> BoundingBox
fn bounding_box(&self) -> BoundingBox
StructurePiece.getBoundingBox: the piece’s box, in world blocks.
fn post_process(
&self,
context: &mut dyn PieceContext,
) -> Result<(), StructureError>
fn post_process( &self, context: &mut dyn PieceContext, ) -> Result<(), StructureError>
StructurePiece.postProcess: place the piece’s blocks and entities
that fall in the chunk context clips to. Writes outside it are
dropped silently, as vanilla’s placeBlock skips them.
fn add_additional_save_data(&self, tag: &mut BTreeMap<JavaString, Tag>)
fn add_additional_save_data(&self, tag: &mut BTreeMap<JavaString, Tag>)
StructurePiece.addAdditionalSaveData: the piece’s own fields, saved
beside BB/O/GD and read back by the type’s load_piece.
Trait Implementations§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".