Skip to main content

steel_core/behavior/blocks/
utils.rs

1use steel_registry::blocks::BlockRef;
2use steel_registry::blocks::properties::{BlockStateProperties, BoolProperty};
3use steel_registry::vanilla_block_tags::BlockTag;
4use steel_registry::vanilla_blocks::{
5    BARRIER, CARVED_PUMPKIN, JACK_O_LANTERN, MANGROVE_LEAVES, MELON, PUMPKIN,
6};
7use steel_utils::Direction;
8
9pub fn is_excluded_for_connection(block: BlockRef) -> bool {
10    block.has_tag(&BlockTag::LEAVES)
11        || block == &BARRIER
12        || block == &CARVED_PUMPKIN
13        || block == &JACK_O_LANTERN
14        || block == &MELON
15        || block == &PUMPKIN
16        || block.has_tag(&BlockTag::SHULKER_BOXES)
17        || block == &MANGROVE_LEAVES
18}
19
20pub(crate) const fn multiface_face_property(direction: Direction) -> &'static BoolProperty {
21    match direction {
22        Direction::Up => &BlockStateProperties::UP,
23        Direction::Down => &BlockStateProperties::DOWN,
24        Direction::North => &BlockStateProperties::NORTH,
25        Direction::South => &BlockStateProperties::SOUTH,
26        Direction::East => &BlockStateProperties::EAST,
27        Direction::West => &BlockStateProperties::WEST,
28    }
29}