package com.dairymoose.modernlife.blocks;

import javax.annotation.Nullable;
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.Mirror;
import net.minecraft.world.level.block.Rotation;
import net.minecraft.world.level.block.state.BlockBehaviour;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.block.state.properties.AttachFace;
import net.minecraft.world.level.block.state.properties.BlockStateProperties;
import net.minecraft.world.level.block.state.properties.DirectionProperty;
import net.minecraft.world.level.block.state.properties.EnumProperty;
import net.minecraft.world.phys.shapes.Shapes;
import net.minecraft.world.phys.shapes.VoxelShape;

/* loaded from: outputsrg.jar:com/dairymoose/modernlife/blocks/AbstractPanelBlock.class */
public class AbstractPanelBlock extends Block {
    public static final EnumProperty<AttachFace> FACE = BlockStateProperties.ATTACH_FACE;
    public static final DirectionProperty FACING = BlockStateProperties.HORIZONTAL_FACING;

    public AbstractPanelBlock(Properties p_i48440_1_) {
        super(p_i48440_1_);
    }

    public BlockState rotate(BlockState state, Rotation rotation) {
        return (BlockState) state.setValue(FACING, rotation.rotate(state.getValue(FACING)));
    }

    public BlockState mirror(BlockState state, Mirror mirror) {
        return state.rotate(mirror.getRotation(state.getValue(FACING)));
    }

    @Deprecated
    public VoxelShape getOcclusionShape(BlockState p_196247_1_, BlockGetter p_196247_2_, BlockPos p_196247_3_) {
        return Shapes.empty();
    }

    @Nullable
    public BlockState getStateForPlacement(BlockPlaceContext p_196258_1_) {
        Direction horDir = p_196258_1_.getHorizontalDirection();
        Direction clickedFace = p_196258_1_.getClickedFace();
        p_196258_1_.getClickedPos();
        p_196258_1_.isInside();
        AttachFace attach = AttachFace.WALL;
        if (clickedFace == Direction.UP) {
            attach = AttachFace.FLOOR;
        } else if (clickedFace == Direction.DOWN) {
            attach = AttachFace.CEILING;
        }
        return (BlockState) ((BlockState) defaultBlockState().setValue(FACE, attach)).setValue(FACING, horDir.getOpposite());
    }
}
