Trait GroundStateProvider
pub trait GroundStateProvider:
Send
+ Sync
+ 'static {
// Required method
fn state_at(
&self,
level: &mut dyn GroundLevel,
pos: [i32; 3],
) -> Option<BlockStateId>;
}Expand description
A mod’s ground provider: NeoForge’s AlterGroundEvent.StateProvider.
Implemented once, kept by the game, deterministic and stateless.
Required Methods§
fn state_at(
&self,
level: &mut dyn GroundLevel,
pos: [i32; 3],
) -> Option<BlockStateId>
fn state_at( &self, level: &mut dyn GroundLevel, pos: [i32; 3], ) -> Option<BlockStateId>
StateProvider.getState: the state to place at pos, or None to try
the next position down the column, as the decorator’s own provider
answers where it finds no ground it replaces. Draw only from
level.random(), so the same seed gives the same ground.
Trait Implementations§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".