Trait GroundLevel
pub trait GroundLevel {
// Required methods
fn block_state(&mut self, pos: [i32; 3]) -> BlockStateId;
fn decorator_state(&mut self, pos: [i32; 3]) -> Option<BlockStateId>;
fn random(&mut self) -> &mut dyn StructureRandom;
}Expand description
What a ground provider reads while the decorator asks it: vanilla’s
WorldGenLevel as far as ground needs it, and the decorator’s random.
Required Methods§
fn block_state(&mut self, pos: [i32; 3]) -> BlockStateId
fn block_state(&mut self, pos: [i32; 3]) -> BlockStateId
BlockGetter.getBlockState: the block at pos in the region the tree
decorates.
fn decorator_state(&mut self, pos: [i32; 3]) -> Option<BlockStateId>
fn decorator_state(&mut self, pos: [i32; 3]) -> Option<BlockStateId>
The decorator’s own provider at pos
(BlockStateProvider.getOptionalState), drawing from the same random:
what GroundProvider::Decorator answers.
fn random(&mut self) -> &mut dyn StructureRandom
fn random(&mut self) -> &mut dyn StructureRandom
The decorator’s random (TreeDecorator.Context.random()): a provider’s
draws come between the decorator’s own, in the order it asks.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".