package net.minecraft.world.level.block;

import net.minecraft.world.level.block.state.StateHolder;
import net.minecraft.world.level.block.state.StateDefinition;
import net.minecraft.world.level.LevelAccessor;
import net.minecraft.core.BlockPos;
import net.minecraft.world.level.BlockGetter;
import net.minecraft.world.item.BlockPlaceContext;
import net.minecraft.world.level.block.state.properties.Property;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.block.state.BlockBehaviour;
import net.minecraft.core.Direction;
import java.util.Map;
import net.minecraft.world.level.block.state.properties.BooleanProperty;

public class HugeMushroomBlock extends Block {
    public static final BooleanProperty NORTH;
    public static final BooleanProperty EAST;
    public static final BooleanProperty SOUTH;
    public static final BooleanProperty WEST;
    public static final BooleanProperty UP;
    public static final BooleanProperty DOWN;
    private static final Map<Direction, BooleanProperty> PROPERTY_BY_DIRECTION;
    
    public HugeMushroomBlock(final Properties c) {
        super(c);
        this.registerDefaultState((((((((StateHolder<O, BlockState>)this.stateDefinition.any()).setValue((Property<Comparable>)HugeMushroomBlock.NORTH, true)).setValue((Property<Comparable>)HugeMushroomBlock.EAST, true)).setValue((Property<Comparable>)HugeMushroomBlock.SOUTH, true)).setValue((Property<Comparable>)HugeMushroomBlock.WEST, true)).setValue((Property<Comparable>)HugeMushroomBlock.UP, true)).<Comparable, Boolean>setValue((Property<Comparable>)HugeMushroomBlock.DOWN, true));
    }
    
    @Override
    public BlockState getStateForPlacement(final BlockPlaceContext bin) {
        final BlockGetter bpg3 = bin.getLevel();
        final BlockPos fu4 = bin.getClickedPos();
        return (((((((StateHolder<O, BlockState>)this.defaultBlockState()).setValue((Property<Comparable>)HugeMushroomBlock.DOWN, this != bpg3.getBlockState(fu4.below()).getBlock())).setValue((Property<Comparable>)HugeMushroomBlock.UP, this != bpg3.getBlockState(fu4.above()).getBlock())).setValue((Property<Comparable>)HugeMushroomBlock.NORTH, this != bpg3.getBlockState(fu4.north()).getBlock())).setValue((Property<Comparable>)HugeMushroomBlock.EAST, this != bpg3.getBlockState(fu4.east()).getBlock())).setValue((Property<Comparable>)HugeMushroomBlock.SOUTH, this != bpg3.getBlockState(fu4.south()).getBlock())).<Comparable, Boolean>setValue((Property<Comparable>)HugeMushroomBlock.WEST, this != bpg3.getBlockState(fu4.west()).getBlock());
    }
    
    @Override
    public BlockState updateShape(final BlockState cfj1, final Direction fz, final BlockState cfj3, final LevelAccessor bqc, final BlockPos fu5, final BlockPos fu6) {
        if (cfj3.is(this)) {
            return ((StateHolder<O, BlockState>)cfj1).<Comparable, Boolean>setValue((Property<Comparable>)HugeMushroomBlock.PROPERTY_BY_DIRECTION.get(fz), false);
        }
        return super.updateShape(cfj1, fz, cfj3, bqc, fu5, fu6);
    }
    
    @Override
    public BlockState rotate(final BlockState cfj, final Rotation cap) {
        return (((((((StateHolder<O, BlockState>)cfj).setValue((Property<Comparable>)HugeMushroomBlock.PROPERTY_BY_DIRECTION.get(cap.rotate(Direction.NORTH)), (Comparable)cfj.<V>getValue((Property<V>)HugeMushroomBlock.NORTH))).setValue((Property<Comparable>)HugeMushroomBlock.PROPERTY_BY_DIRECTION.get(cap.rotate(Direction.SOUTH)), (Comparable)cfj.<V>getValue((Property<V>)HugeMushroomBlock.SOUTH))).setValue((Property<Comparable>)HugeMushroomBlock.PROPERTY_BY_DIRECTION.get(cap.rotate(Direction.EAST)), (Comparable)cfj.<V>getValue((Property<V>)HugeMushroomBlock.EAST))).setValue((Property<Comparable>)HugeMushroomBlock.PROPERTY_BY_DIRECTION.get(cap.rotate(Direction.WEST)), (Comparable)cfj.<V>getValue((Property<V>)HugeMushroomBlock.WEST))).setValue((Property<Comparable>)HugeMushroomBlock.PROPERTY_BY_DIRECTION.get(cap.rotate(Direction.UP)), (Comparable)cfj.<V>getValue((Property<V>)HugeMushroomBlock.UP))).<Comparable, Comparable>setValue((Property<Comparable>)HugeMushroomBlock.PROPERTY_BY_DIRECTION.get(cap.rotate(Direction.DOWN)), (Comparable)cfj.<V>getValue((Property<V>)HugeMushroomBlock.DOWN));
    }
    
    @Override
    public BlockState mirror(final BlockState cfj, final Mirror bzj) {
        return (((((((StateHolder<O, BlockState>)cfj).setValue((Property<Comparable>)HugeMushroomBlock.PROPERTY_BY_DIRECTION.get(bzj.mirror(Direction.NORTH)), (Comparable)cfj.<V>getValue((Property<V>)HugeMushroomBlock.NORTH))).setValue((Property<Comparable>)HugeMushroomBlock.PROPERTY_BY_DIRECTION.get(bzj.mirror(Direction.SOUTH)), (Comparable)cfj.<V>getValue((Property<V>)HugeMushroomBlock.SOUTH))).setValue((Property<Comparable>)HugeMushroomBlock.PROPERTY_BY_DIRECTION.get(bzj.mirror(Direction.EAST)), (Comparable)cfj.<V>getValue((Property<V>)HugeMushroomBlock.EAST))).setValue((Property<Comparable>)HugeMushroomBlock.PROPERTY_BY_DIRECTION.get(bzj.mirror(Direction.WEST)), (Comparable)cfj.<V>getValue((Property<V>)HugeMushroomBlock.WEST))).setValue((Property<Comparable>)HugeMushroomBlock.PROPERTY_BY_DIRECTION.get(bzj.mirror(Direction.UP)), (Comparable)cfj.<V>getValue((Property<V>)HugeMushroomBlock.UP))).<Comparable, Comparable>setValue((Property<Comparable>)HugeMushroomBlock.PROPERTY_BY_DIRECTION.get(bzj.mirror(Direction.DOWN)), (Comparable)cfj.<V>getValue((Property<V>)HugeMushroomBlock.DOWN));
    }
    
    @Override
    protected void createBlockStateDefinition(final StateDefinition.Builder<Block, BlockState> a) {
        a.add(HugeMushroomBlock.UP, HugeMushroomBlock.DOWN, HugeMushroomBlock.NORTH, HugeMushroomBlock.EAST, HugeMushroomBlock.SOUTH, HugeMushroomBlock.WEST);
    }
    
    static {
        NORTH = PipeBlock.NORTH;
        EAST = PipeBlock.EAST;
        SOUTH = PipeBlock.SOUTH;
        WEST = PipeBlock.WEST;
        UP = PipeBlock.UP;
        DOWN = PipeBlock.DOWN;
        PROPERTY_BY_DIRECTION = PipeBlock.PROPERTY_BY_DIRECTION;
    }
}
