pub trait Bonemealable {
// Required methods
fn is_valid_bonemeal_target(
&self,
state: BlockStateId,
world: &dyn LevelReader,
pos: BlockPos,
) -> bool;
fn perform_bonemeal(
&self,
state: BlockStateId,
world: &Arc<World>,
rng: &mut dyn Rng,
pos: BlockPos,
);
// Provided methods
fn get_bonemeal_age_increase(
&self,
_world: &Arc<World>,
_rng: &mut dyn Rng,
) -> u8 { ... }
fn is_bonemeal_success(
&self,
_state: BlockStateId,
_world: &Arc<World>,
_rng: &mut dyn Rng,
_pos: BlockPos,
) -> bool { ... }
fn bonemeal_action_type(&self) -> BonemealAction { ... }
}Expand description
Blocks that react to bonemeal.
Required Methods§
Sourcefn is_valid_bonemeal_target(
&self,
state: BlockStateId,
world: &dyn LevelReader,
pos: BlockPos,
) -> bool
fn is_valid_bonemeal_target( &self, state: BlockStateId, world: &dyn LevelReader, pos: BlockPos, ) -> bool
Returns whether this block is a valid bonemeal target.
Sourcefn perform_bonemeal(
&self,
state: BlockStateId,
world: &Arc<World>,
rng: &mut dyn Rng,
pos: BlockPos,
)
fn perform_bonemeal( &self, state: BlockStateId, world: &Arc<World>, rng: &mut dyn Rng, pos: BlockPos, )
Applies the bonemeal effect.
Provided Methods§
Sourcefn get_bonemeal_age_increase(
&self,
_world: &Arc<World>,
_rng: &mut dyn Rng,
) -> u8
fn get_bonemeal_age_increase( &self, _world: &Arc<World>, _rng: &mut dyn Rng, ) -> u8
Returns the age increase from bonemeal.
Sourcefn is_bonemeal_success(
&self,
_state: BlockStateId,
_world: &Arc<World>,
_rng: &mut dyn Rng,
_pos: BlockPos,
) -> bool
fn is_bonemeal_success( &self, _state: BlockStateId, _world: &Arc<World>, _rng: &mut dyn Rng, _pos: BlockPos, ) -> bool
Returns whether bonemeal succeeds after the target check passes.
Sourcefn bonemeal_action_type(&self) -> BonemealAction
fn bonemeal_action_type(&self) -> BonemealAction
Returns how this block uses bonemeal.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".