Skip to main content

BlockStateBehaviorExt

Trait BlockStateBehaviorExt 

Source
pub trait BlockStateBehaviorExt {
    // Required methods
    fn is_liquid_container(&self) -> bool;
    fn can_be_replaced_by_fluid(&self, fluid_block: BlockRef) -> bool;
    fn can_be_replaced(&self, context: &BlockPlaceContext<'_>) -> bool;
    fn is_pathfindable(&self, computation_type: PathComputationType) -> bool;
    fn is_bed(&self) -> bool;
    fn is_liquid_block(&self) -> bool;
    fn is_possible_to_respawn_in_this(&self) -> bool;
}
Expand description

Extension trait for BlockStateId that provides access to behavior-dependent methods.

This is separate from BlockStateExt (in steel-registry) because these methods require access to the behavior registry which lives in steel-core.

Required Methods§

Source

fn is_liquid_container(&self) -> bool

Returns whether this block state belongs to a vanilla LiquidBlockContainer.

Source

fn can_be_replaced_by_fluid(&self, fluid_block: BlockRef) -> bool

Returns whether this block state can be replaced by the given fluid block.

Source

fn can_be_replaced(&self, context: &BlockPlaceContext<'_>) -> bool

Returns whether this block state can be replaced in this placement context.

Source

fn is_pathfindable(&self, computation_type: PathComputationType) -> bool

Returns whether this block state is pathfindable for the supplied vanilla computation type.

Source

fn is_bed(&self) -> bool

Returns whether this block state extends BedBlock

Source

fn is_liquid_block(&self) -> bool

Returns whether this block state extends LiquidBlock.

Source

fn is_possible_to_respawn_in_this(&self) -> bool

Returns whether this block state can be occupied by a forced respawn position

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§