package net.minecraft.world.level.block;

import net.minecraft.world.level.block.state.AbstractStateHolder;
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.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((((((((AbstractStateHolder<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 bcq) {
        final BlockGetter bjg3 = bcq.getLevel();
        final BlockPos fk4 = bcq.getClickedPos();
        return (((((((AbstractStateHolder<O, BlockState>)this.defaultBlockState()).setValue((Property<Comparable>)HugeMushroomBlock.DOWN, this != bjg3.getBlockState(fk4.below()).getBlock())).setValue((Property<Comparable>)HugeMushroomBlock.UP, this != bjg3.getBlockState(fk4.above()).getBlock())).setValue((Property<Comparable>)HugeMushroomBlock.NORTH, this != bjg3.getBlockState(fk4.north()).getBlock())).setValue((Property<Comparable>)HugeMushroomBlock.EAST, this != bjg3.getBlockState(fk4.east()).getBlock())).setValue((Property<Comparable>)HugeMushroomBlock.SOUTH, this != bjg3.getBlockState(fk4.south()).getBlock())).<Comparable, Boolean>setValue((Property<Comparable>)HugeMushroomBlock.WEST, this != bjg3.getBlockState(fk4.west()).getBlock());
    }
    
    @Override
    public BlockState updateShape(final BlockState byj1, final Direction fp, final BlockState byj3, final LevelAccessor bjx, final BlockPos fk5, final BlockPos fk6) {
        if (byj3.getBlock() == this) {
            return ((AbstractStateHolder<O, BlockState>)byj1).<Comparable, Boolean>setValue((Property<Comparable>)HugeMushroomBlock.PROPERTY_BY_DIRECTION.get(fp), false);
        }
        return super.updateShape(byj1, fp, byj3, bjx, fk5, fk6);
    }
    
    @Override
    public BlockState rotate(final BlockState byj, final Rotation btu) {
        return (((((((AbstractStateHolder<O, BlockState>)byj).setValue((Property<Comparable>)HugeMushroomBlock.PROPERTY_BY_DIRECTION.get(btu.rotate(Direction.NORTH)), (Comparable)byj.<V>getValue((Property<V>)HugeMushroomBlock.NORTH))).setValue((Property<Comparable>)HugeMushroomBlock.PROPERTY_BY_DIRECTION.get(btu.rotate(Direction.SOUTH)), (Comparable)byj.<V>getValue((Property<V>)HugeMushroomBlock.SOUTH))).setValue((Property<Comparable>)HugeMushroomBlock.PROPERTY_BY_DIRECTION.get(btu.rotate(Direction.EAST)), (Comparable)byj.<V>getValue((Property<V>)HugeMushroomBlock.EAST))).setValue((Property<Comparable>)HugeMushroomBlock.PROPERTY_BY_DIRECTION.get(btu.rotate(Direction.WEST)), (Comparable)byj.<V>getValue((Property<V>)HugeMushroomBlock.WEST))).setValue((Property<Comparable>)HugeMushroomBlock.PROPERTY_BY_DIRECTION.get(btu.rotate(Direction.UP)), (Comparable)byj.<V>getValue((Property<V>)HugeMushroomBlock.UP))).<Comparable, Comparable>setValue((Property<Comparable>)HugeMushroomBlock.PROPERTY_BY_DIRECTION.get(btu.rotate(Direction.DOWN)), (Comparable)byj.<V>getValue((Property<V>)HugeMushroomBlock.DOWN));
    }
    
    @Override
    public BlockState mirror(final BlockState byj, final Mirror bsu) {
        return (((((((AbstractStateHolder<O, BlockState>)byj).setValue((Property<Comparable>)HugeMushroomBlock.PROPERTY_BY_DIRECTION.get(bsu.mirror(Direction.NORTH)), (Comparable)byj.<V>getValue((Property<V>)HugeMushroomBlock.NORTH))).setValue((Property<Comparable>)HugeMushroomBlock.PROPERTY_BY_DIRECTION.get(bsu.mirror(Direction.SOUTH)), (Comparable)byj.<V>getValue((Property<V>)HugeMushroomBlock.SOUTH))).setValue((Property<Comparable>)HugeMushroomBlock.PROPERTY_BY_DIRECTION.get(bsu.mirror(Direction.EAST)), (Comparable)byj.<V>getValue((Property<V>)HugeMushroomBlock.EAST))).setValue((Property<Comparable>)HugeMushroomBlock.PROPERTY_BY_DIRECTION.get(bsu.mirror(Direction.WEST)), (Comparable)byj.<V>getValue((Property<V>)HugeMushroomBlock.WEST))).setValue((Property<Comparable>)HugeMushroomBlock.PROPERTY_BY_DIRECTION.get(bsu.mirror(Direction.UP)), (Comparable)byj.<V>getValue((Property<V>)HugeMushroomBlock.UP))).<Comparable, Comparable>setValue((Property<Comparable>)HugeMushroomBlock.PROPERTY_BY_DIRECTION.get(bsu.mirror(Direction.DOWN)), (Comparable)byj.<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;
    }
}
