pub struct BlockState(/* private fields */);Expand description
A 1.12 block state: block_id << 4 | meta, exactly the wire / palette value.
Implementations§
Source§impl BlockState
impl BlockState
Sourcepub const AIR: BlockState
pub const AIR: BlockState
Air (raw 0).
Sourcepub fn from_raw(raw: u16) -> Option<BlockState>
pub fn from_raw(raw: u16) -> Option<BlockState>
Wraps a raw id << 4 | meta value; None if the id is not a 1.12 block.
Sourcepub fn from_raw_vanilla(raw: u16) -> BlockState
pub fn from_raw_vanilla(raw: u16) -> BlockState
Vanilla’s palette mapping: unknown block ids and unregistered metas become air.
Sourcepub fn is_registered(self) -> bool
pub fn is_registered(self) -> bool
true when vanilla 1.12.2 has a block state for this (id, meta); otherwise it reads as air.
Sourcepub const fn new(block: Block, meta: u8) -> BlockState
pub const fn new(block: Block, meta: u8) -> BlockState
Builds a state from a block and metadata (meta & 15).
Sourcepub fn collision(self) -> Collision
pub fn collision(self) -> Collision
Collision boxes and what else they depend on (1.12 places them in double:
Aabb::at).
Sourcepub fn shape(self) -> &'static [Aabb]
pub fn shape(self) -> &'static [Aabb]
The collision boxes from the table (for dependent shapes: the shape with air neighbours).
Sourcepub fn flags(self) -> StateFlags
pub fn flags(self) -> StateFlags
Per-state shape flags.
Sourcepub fn is_normal_cube(self) -> bool
pub fn is_normal_cube(self) -> bool
BlockState.isNormalCube() (see StateFlags::NORMAL_CUBE).
Sourcepub fn is_full_cube(self) -> bool
pub fn is_full_cube(self) -> bool
BlockState.isFullCube().
Sourcepub fn face_shape(self, face: Face) -> FaceShape
pub fn face_shape(self, face: Face) -> FaceShape
The face shape of face with only air around (stairs: the straight shape; their real
face shape follows the actual stairs shape).