package net.minecraft.world.level.block;

import net.minecraft.world.level.block.state.StateHolder;
import net.minecraft.world.level.block.state.properties.BlockStateProperties;
import net.minecraft.world.level.block.state.StateDefinition;
import net.minecraft.world.item.BlockPlaceContext;
import net.minecraft.core.BlockPos;
import net.minecraft.world.level.LevelAccessor;
import net.minecraft.core.Direction;
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.world.level.block.state.properties.BooleanProperty;

public class SnowyDirtBlock extends Block {
    public static final BooleanProperty SNOWY;
    
    protected SnowyDirtBlock(final Properties c) {
        super(c);
        this.registerDefaultState(((StateHolder<O, BlockState>)this.stateDefinition.any()).<Comparable, Boolean>setValue((Property<Comparable>)SnowyDirtBlock.SNOWY, false));
    }
    
    @Override
    public BlockState updateShape(final BlockState cfj1, final Direction fz, final BlockState cfj3, final LevelAccessor bqc, final BlockPos fu5, final BlockPos fu6) {
        if (fz == Direction.UP) {
            return ((StateHolder<O, BlockState>)cfj1).<Comparable, Boolean>setValue((Property<Comparable>)SnowyDirtBlock.SNOWY, cfj3.is(Blocks.SNOW_BLOCK) || cfj3.is(Blocks.SNOW));
        }
        return super.updateShape(cfj1, fz, cfj3, bqc, fu5, fu6);
    }
    
    @Override
    public BlockState getStateForPlacement(final BlockPlaceContext bin) {
        final BlockState cfj3 = bin.getLevel().getBlockState(bin.getClickedPos().above());
        return ((StateHolder<O, BlockState>)this.defaultBlockState()).<Comparable, Boolean>setValue((Property<Comparable>)SnowyDirtBlock.SNOWY, cfj3.is(Blocks.SNOW_BLOCK) || cfj3.is(Blocks.SNOW));
    }
    
    @Override
    protected void createBlockStateDefinition(final StateDefinition.Builder<Block, BlockState> a) {
        a.add(SnowyDirtBlock.SNOWY);
    }
    
    static {
        SNOWY = BlockStateProperties.SNOWY;
    }
}
