package com.dairymoose.modernlife.blocks;

import net.minecraft.core.BlockPos;
import net.minecraft.core.Direction;
import net.minecraft.world.item.context.BlockPlaceContext;
import net.minecraft.world.level.BlockGetter;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.SoundType;
import net.minecraft.world.level.block.state.BlockBehaviour;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.block.state.StateDefinition;
import net.minecraft.world.level.block.state.properties.BlockStateProperties;
import net.minecraft.world.level.block.state.properties.EnumProperty;
import net.minecraft.world.level.block.state.properties.Property;
import net.minecraft.world.level.material.Material;
import net.minecraft.world.phys.shapes.CollisionContext;
import net.minecraft.world.phys.shapes.VoxelShape;

/* loaded from: outputsrg.jar:com/dairymoose/modernlife/blocks/OakPostBlock.class */
public class OakPostBlock extends Block {
    protected static final VoxelShape SHAPE = Block.box(6.0d, 0.0d, 6.0d, 10.0d, 10.0d, 10.0d);
    public static final EnumProperty<Direction.Axis> AXIS = BlockStateProperties.AXIS;

    public OakPostBlock() {
        super(Properties.of(Material.WOOD).sound(SoundType.WOOD));
        registerDefaultState((BlockState) this.stateDefinition.any().setValue(AXIS, Direction.Axis.Y));
    }

    protected void createBlockStateDefinition(StateDefinition.Builder<Block, BlockState> builder) {
        builder.add(new Property[]{AXIS});
    }

    public VoxelShape getShape(BlockState p_220053_1_, BlockGetter p_220053_2_, BlockPos p_220053_3_, CollisionContext p_220053_4_) {
        return SHAPE;
    }

    public BlockState getStateForPlacement(BlockPlaceContext context) {
        if (context.getClickedFace() == Direction.NORTH || context.getClickedFace() == Direction.SOUTH) {
            return (BlockState) defaultBlockState().setValue(AXIS, Direction.Axis.Z);
        }
        if (context.getClickedFace() == Direction.EAST || context.getClickedFace() == Direction.WEST) {
            return (BlockState) defaultBlockState().setValue(AXIS, Direction.Axis.X);
        }
        if (context.getClickedFace() == Direction.UP || context.getClickedFace() == Direction.DOWN) {
            return (BlockState) defaultBlockState().setValue(AXIS, Direction.Axis.Y);
        }
        return defaultBlockState();
    }
}
