Skip to main content

Bonemealable

Trait Bonemealable 

Source
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§

Source

fn is_valid_bonemeal_target( &self, state: BlockStateId, world: &dyn LevelReader, pos: BlockPos, ) -> bool

Returns whether this block is a valid bonemeal target.

Source

fn perform_bonemeal( &self, state: BlockStateId, world: &Arc<World>, rng: &mut dyn Rng, pos: BlockPos, )

Applies the bonemeal effect.

Provided Methods§

Source

fn get_bonemeal_age_increase( &self, _world: &Arc<World>, _rng: &mut dyn Rng, ) -> u8

Returns the age increase from bonemeal.

Source

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.

Source

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".

Implementors§

Source§

impl Bonemealable for BambooSaplingBlock

Source§

impl Bonemealable for BambooStalkBlock

Source§

impl Bonemealable for BeetrootBlock

Source§

impl Bonemealable for BigDripleafBlock

Source§

impl Bonemealable for BigDripleafStemBlock

Source§

impl Bonemealable for BushBlock

Source§

impl Bonemealable for CarrotBlock

Source§

impl Bonemealable for CaveVinesBlock

Source§

impl Bonemealable for CaveVinesPlantBlock

Source§

impl Bonemealable for CocoaBlock

Source§

impl Bonemealable for CropBlock

Source§

impl Bonemealable for FireflyBushBlock

Source§

impl Bonemealable for FlowerBedBlock

Source§

impl Bonemealable for GrowingPlantBodyBlock

Source§

impl Bonemealable for GrowingPlantHeadBlock

Source§

impl Bonemealable for HangingMossBlock

Source§

impl Bonemealable for KelpBlock

Source§

impl Bonemealable for KelpPlantBlock

Source§

impl Bonemealable for MangroveLeavesBlock

Source§

impl Bonemealable for PitcherCropBlock

Source§

impl Bonemealable for PotatoBlock

Source§

impl Bonemealable for RootedDirtBlock

Source§

impl Bonemealable for SeagrassBlock

Source§

impl Bonemealable for ShortDryGrassBlock

Source§

impl Bonemealable for SmallDripleafBlock

Source§

impl Bonemealable for SweetBerryBushBlock

Source§

impl Bonemealable for TallDryGrassBlock

Source§

impl Bonemealable for TallFlowerBlock

Source§

impl Bonemealable for TallGrassBlock

Source§

impl Bonemealable for TorchflowerCropBlock

Source§

impl Bonemealable for TwistingVinesBlock

Source§

impl Bonemealable for TwistingVinesPlantBlock

Source§

impl Bonemealable for WeepingVinesBlock

Source§

impl Bonemealable for WeepingVinesPlantBlock