use pumpkin_data::Block; use pumpkin_world::BlockStateId; use crate::block::{ BlockBehaviour, BlockFuture, BlockMetadata, CanPlaceAtArgs, GetStateForNeighborUpdateArgs, blocks::plant::PlantBlockBase, }; pub struct ShortPlantBlock; impl BlockMetadata for ShortPlantBlock { fn ids() -> Box<[u16]> { [Block::SHORT_GRASS.id, Block::FERN.id].into() } } impl BlockBehaviour for ShortPlantBlock { fn can_place_at<'a>(&'a self, args: CanPlaceAtArgs<'a>) -> BlockFuture<'a, bool> { Box::pin(async move { ::can_place_at(self, args.block_accessor, args.position).await }) } fn get_state_for_neighbor_update<'a>( &'a self, args: GetStateForNeighborUpdateArgs<'a>, ) -> BlockFuture<'a, BlockStateId> { Box::pin(async move { ::get_state_for_neighbor_update( self, args.world, args.position, args.state_id, ) .await }) } } impl PlantBlockBase for ShortPlantBlock {}