pub trait BlockStateExt {
Show 36 methods
// Required methods
fn get_block(&self) -> BlockRef;
fn is_air(&self) -> bool;
fn get_ticking_metadata(&self) -> BlockStateTickingMetadata;
fn get_fluid_state(&self) -> FluidState;
fn has_fluid(&self) -> bool;
fn is_randomly_ticking(&self) -> bool;
fn has_block_entity(&self) -> bool;
fn get_value<P: Property>(&self, property: &P) -> P::Value;
fn try_get_value<P: Property>(&self, property: &P) -> Option<P::Value>;
fn set_value<P: Property>(
&self,
property: &P,
value: P::Value,
) -> BlockStateId;
fn copy_value<P: Property, O: BlockStateExt>(
&self,
property: &P,
other: &O,
) -> BlockStateId;
fn get_property_str(&self, name: &str) -> Option<String>;
fn with_properties_of(&self, source: BlockStateId) -> BlockStateId;
fn get_static_collision_shape(&self) -> VoxelShape;
fn get_collision_shape_at(&self, pos: BlockPos) -> OffsetVoxelShape;
fn get_static_support_shape(&self) -> VoxelShape;
fn get_support_shape_at(&self, pos: BlockPos) -> OffsetVoxelShape;
fn get_static_outline_shape(&self) -> VoxelShape;
fn get_outline_shape_at(&self, pos: BlockPos) -> OffsetVoxelShape;
fn get_occlusion_shape(&self) -> VoxelShape;
fn get_static_interaction_shape(&self) -> VoxelShape;
fn get_interaction_shape_at(&self, pos: BlockPos) -> OffsetVoxelShape;
fn get_static_visual_shape(&self) -> VoxelShape;
fn get_visual_shape_at(&self, pos: BlockPos) -> OffsetVoxelShape;
fn get_light_emission(&self) -> u8;
fn get_light_dampening(&self) -> u8;
fn use_shape_for_light_occlusion(&self) -> bool;
fn get_offset(&self, pos: BlockPos) -> DVec3;
fn is_face_sturdy_at(&self, pos: BlockPos, direction: Direction) -> bool;
fn is_face_sturdy_for_at(
&self,
pos: BlockPos,
direction: Direction,
support_type: SupportType,
) -> bool;
fn is_solid(&self) -> bool;
fn blocks_motion(&self) -> bool;
fn is_solid_render(&self) -> bool;
fn is_suffocating(&self) -> bool;
fn is_static_redstone_conductor(&self) -> bool;
fn is_replaceable(&self) -> bool;
}Required Methods§
fn get_block(&self) -> BlockRef
fn is_air(&self) -> bool
Sourcefn get_ticking_metadata(&self) -> BlockStateTickingMetadata
fn get_ticking_metadata(&self) -> BlockStateTickingMetadata
Returns Vanilla’s immutable cached fluid/random-tick metadata for this state.
Sourcefn get_fluid_state(&self) -> FluidState
fn get_fluid_state(&self) -> FluidState
Mirrors Vanilla’s cached BlockState.getFluidState().
Sourcefn is_randomly_ticking(&self) -> bool
fn is_randomly_ticking(&self) -> bool
Mirrors Vanilla’s cached BlockState.isRandomlyTicking() for the block callback.
Sourcefn has_block_entity(&self) -> bool
fn has_block_entity(&self) -> bool
Returns whether this block structurally supports a block entity.
Extracted Vanilla type memberships match EntityBlock exactly. Steel extends that into a
registration contract: plugin blocks must be accepted by at least one registered block
entity type, while the owning block behavior remains responsible for instance creation.
fn get_value<P: Property>(&self, property: &P) -> P::Value
Sourcefn try_get_value<P: Property>(&self, property: &P) -> Option<P::Value>
fn try_get_value<P: Property>(&self, property: &P) -> Option<P::Value>
Gets the value of a property, returning None if the block doesn’t have this property.
fn set_value<P: Property>(&self, property: &P, value: P::Value) -> BlockStateId
fn copy_value<P: Property, O: BlockStateExt>( &self, property: &P, other: &O, ) -> BlockStateId
fn get_property_str(&self, name: &str) -> Option<String>
fn with_properties_of(&self, source: BlockStateId) -> BlockStateId
fn get_static_collision_shape(&self) -> VoxelShape
fn get_collision_shape_at(&self, pos: BlockPos) -> OffsetVoxelShape
fn get_static_support_shape(&self) -> VoxelShape
fn get_support_shape_at(&self, pos: BlockPos) -> OffsetVoxelShape
fn get_static_outline_shape(&self) -> VoxelShape
fn get_outline_shape_at(&self, pos: BlockPos) -> OffsetVoxelShape
fn get_occlusion_shape(&self) -> VoxelShape
fn get_static_interaction_shape(&self) -> VoxelShape
fn get_interaction_shape_at(&self, pos: BlockPos) -> OffsetVoxelShape
fn get_static_visual_shape(&self) -> VoxelShape
fn get_visual_shape_at(&self, pos: BlockPos) -> OffsetVoxelShape
Sourcefn get_light_emission(&self) -> u8
fn get_light_emission(&self) -> u8
Returns this block state’s block light emission, in vanilla’s 0-15 range.
Sourcefn get_light_dampening(&self) -> u8
fn get_light_dampening(&self) -> u8
Returns this block state’s light dampening, in vanilla’s 0-15 range.
Sourcefn use_shape_for_light_occlusion(&self) -> bool
fn use_shape_for_light_occlusion(&self) -> bool
Returns true if vanilla uses face shapes for light occlusion on this state.
Sourcefn get_offset(&self, pos: BlockPos) -> DVec3
fn get_offset(&self, pos: BlockPos) -> DVec3
Mirrors vanilla BlockState.getOffset(BlockPos).
Sourcefn is_face_sturdy_at(&self, pos: BlockPos, direction: Direction) -> bool
fn is_face_sturdy_at(&self, pos: BlockPos, direction: Direction) -> bool
Checks if this block face is sturdy enough to support other blocks.
Uses SupportType::Full by default.
Sourcefn is_face_sturdy_for_at(
&self,
pos: BlockPos,
direction: Direction,
support_type: SupportType,
) -> bool
fn is_face_sturdy_for_at( &self, pos: BlockPos, direction: Direction, support_type: SupportType, ) -> bool
Checks if this block face is sturdy for the given support type.
Sourcefn is_solid(&self) -> bool
fn is_solid(&self) -> bool
Checks if this block state is solid (has a full cube collision shape).
This matches vanilla’s BlockState.isSolid() which is used by standing signs
to check if they can be placed on a block.
Sourcefn blocks_motion(&self) -> bool
fn blocks_motion(&self) -> bool
Checks if this block state blocks motion.
This matches vanilla’s BlockState.blocksMotion().
Sourcefn is_solid_render(&self) -> bool
fn is_solid_render(&self) -> bool
Checks if this block state renders as a full solid cube.
This matches vanilla’s cached BlockState.isSolidRender(), based on the
occlusion shape rather than collision shape.
Sourcefn is_suffocating(&self) -> bool
fn is_suffocating(&self) -> bool
Returns vanilla BlockState.isSuffocating.
Sourcefn is_static_redstone_conductor(&self) -> bool
fn is_static_redstone_conductor(&self) -> bool
Returns the extracted static BlockState.isRedstoneConductor value.
Dynamic behavior queries must also receive the live level and position.
Sourcefn is_replaceable(&self) -> bool
fn is_replaceable(&self) -> bool
Returns if a block can be replaced extracted from the minecraft data
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".