package com.dairymoose.modernlife.blocks;

import com.dairymoose.modernlife.util.ModernLifeUtil;
import java.util.stream.Stream;
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.state.BlockBehaviour;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.phys.shapes.BooleanOp;
import net.minecraft.world.phys.shapes.CollisionContext;
import net.minecraft.world.phys.shapes.Shapes;
import net.minecraft.world.phys.shapes.VoxelShape;

/* loaded from: outputsrg.jar:com/dairymoose/modernlife/blocks/DualMonitorBlock.class */
public class DualMonitorBlock extends StandardHorizontalBlock {
    protected static final VoxelShape SHAPE_NORTH = (VoxelShape) Stream.of((Object[]) new VoxelShape[]{Shapes.join(Block.box(-0.5281250000000002d, 0.0d, 6.880624999999999d, 0.546875d, 0.25d, 9.880624999999998d), Block.box(-0.5031249999999998d, 1.9517372179744426d, 4.892322582022786d, 0.4968749999999993d, 2.2017372179744426d, 6.992322582022786d), BooleanOp.OR), Shapes.join(Block.box(-8.003125d, 1.625d, 8.193125d, 7.996874999999999d, 11.624999999999998d, 8.293125000000002d), Block.box(-8.003125d, 1.625d, 8.543125d, 7.996874999999999d, 11.624999999999998d, 8.718124999999997d), BooleanOp.OR), Shapes.join(Block.box(7.996874999999999d, 1.625d, 8.543125d, 23.996875d, 11.624999999999998d, 8.718124999999997d), Shapes.join(Block.box(7.996874999999999d, 1.625d, 8.193125d, 23.996875d, 11.624999999999998d, 8.293125000000002d), Shapes.join(Block.box(15.471874999999999d, 0.0d, 6.880624999999999d, 16.546875d, 0.25d, 9.880624999999998d), Block.box(15.496875d, -0.15000000000000036d, 6.8706249999999995d, 16.496875d, 1.9500000000000002d, 7.1206249999999995d), BooleanOp.OR), BooleanOp.OR), BooleanOp.OR)}).reduce((v1, v2) -> {
        return Shapes.join((VoxelShape) v1, (VoxelShape) v2, BooleanOp.OR);
    }).get();
    protected static final VoxelShape SHAPE_EAST = ModernLifeUtil.RotateVoxelShapeClockwise(SHAPE_NORTH);
    protected static final VoxelShape SHAPE_SOUTH = ModernLifeUtil.RotateVoxelShapeClockwise(SHAPE_EAST);
    protected static final VoxelShape SHAPE_WEST = ModernLifeUtil.RotateVoxelShapeClockwise(SHAPE_SOUTH);

    public DualMonitorBlock(Properties p_i48377_1_) {
        super(p_i48377_1_);
    }

    @Override // com.dairymoose.modernlife.blocks.StandardHorizontalBlock
    public BlockState getStateForPlacement(BlockPlaceContext context) {
        return (BlockState) defaultBlockState().setValue(HorizontalDirectionalBlock.FACING, context.getHorizontalDirection().getOpposite());
    }

    /* renamed from: com.dairymoose.modernlife.blocks.DualMonitorBlock$1 */
    /* loaded from: outputsrg.jar:com/dairymoose/modernlife/blocks/DualMonitorBlock$1.class */
    static /* synthetic */ class C00181 {
        static final /* synthetic */ int[] $SwitchMap$net$minecraft$core$Direction = new int[Direction.values().length];

        static {
            try {
                $SwitchMap$net$minecraft$core$Direction[Direction.NORTH.ordinal()] = 1;
            } catch (NoSuchFieldError e) {
            }
            try {
                $SwitchMap$net$minecraft$core$Direction[Direction.SOUTH.ordinal()] = 2;
            } catch (NoSuchFieldError e2) {
            }
            try {
                $SwitchMap$net$minecraft$core$Direction[Direction.EAST.ordinal()] = 3;
            } catch (NoSuchFieldError e3) {
            }
            try {
                $SwitchMap$net$minecraft$core$Direction[Direction.WEST.ordinal()] = 4;
            } catch (NoSuchFieldError e4) {
            }
        }
    }

    public VoxelShape getShape(BlockState bs, BlockGetter reader, BlockPos pos, CollisionContext sel) {
        switch (C00181.$SwitchMap$net$minecraft$core$Direction[bs.getValue(HorizontalDirectionalBlock.FACING).ordinal()]) {
            case 1:
                return SHAPE_NORTH;
            case 2:
                return SHAPE_SOUTH;
            case 3:
                return SHAPE_EAST;
            case 4:
                return SHAPE_WEST;
            default:
                return SHAPE_NORTH;
        }
    }
}
