BlockSource

Trait BlockSource 

Source
pub trait BlockSource {
    // Required methods
    fn get_block(&self, pos: BlockPosition) -> Option<&InputBlock>;
    fn iter_blocks(
        &self,
    ) -> Box<dyn Iterator<Item = (BlockPosition, &InputBlock)> + '_>;
    fn bounds(&self) -> BoundingBox;
}
Expand description

Trait for block data sources (allows integration with Nucleation).

Required Methods§

Source

fn get_block(&self, pos: BlockPosition) -> Option<&InputBlock>

Get the block at a position.

Source

fn iter_blocks( &self, ) -> Box<dyn Iterator<Item = (BlockPosition, &InputBlock)> + '_>

Iterate over all non-air blocks.

Source

fn bounds(&self) -> BoundingBox

Get the bounding box of all blocks.

Implementors§