steel_core/behavior/blocks/building/
glazed_terracotta_block.rs1use steel_macros::block_behavior;
4use steel_registry::blocks::BlockRef;
5use steel_registry::blocks::block_state_ext::BlockStateExt;
6use steel_registry::blocks::properties::BlockStateProperties;
7use steel_utils::BlockStateId;
8
9use crate::behavior::block::BlockBehavior;
10use crate::behavior::context::BlockPlaceContext;
11
12#[block_behavior]
14pub struct GlazedTerracottaBlock {
15 block: BlockRef,
16}
17
18impl GlazedTerracottaBlock {
19 #[must_use]
21 pub const fn new(block: BlockRef) -> Self {
22 Self { block }
23 }
24}
25
26impl BlockBehavior for GlazedTerracottaBlock {
27 fn get_state_for_placement(&self, context: &BlockPlaceContext<'_>) -> Option<BlockStateId> {
28 Some(self.block.default_state().set_value(
29 &BlockStateProperties::HORIZONTAL_FACING,
30 context.horizontal_direction().opposite(),
31 ))
32 }
33}