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.util.Mth;
import net.minecraft.world.item.BlockPlaceContext;
import net.minecraft.world.phys.shapes.Shapes;
import net.minecraft.world.phys.shapes.CollisionContext;
import net.minecraft.core.BlockPos;
import net.minecraft.world.level.BlockGetter;
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.phys.shapes.VoxelShape;
import net.minecraft.world.level.block.state.properties.IntegerProperty;

public class SkullBlock extends AbstractSkullBlock {
    public static final IntegerProperty ROTATION;
    protected static final VoxelShape SHAPE;
    
    protected SkullBlock(final Type a, final Properties c) {
        super(a, c);
        this.registerDefaultState(((StateHolder<O, BlockState>)this.stateDefinition.any()).<Comparable, Integer>setValue((Property<Comparable>)SkullBlock.ROTATION, 0));
    }
    
    @Override
    public VoxelShape getShape(final BlockState cfj, final BlockGetter bpg, final BlockPos fu, final CollisionContext der) {
        return SkullBlock.SHAPE;
    }
    
    @Override
    public VoxelShape getOcclusionShape(final BlockState cfj, final BlockGetter bpg, final BlockPos fu) {
        return Shapes.empty();
    }
    
    @Override
    public BlockState getStateForPlacement(final BlockPlaceContext bin) {
        return ((StateHolder<O, BlockState>)this.defaultBlockState()).<Comparable, Integer>setValue((Property<Comparable>)SkullBlock.ROTATION, Mth.floor(bin.getRotation() * 16.0f / 360.0f + 0.5) & 0xF);
    }
    
    @Override
    public BlockState rotate(final BlockState cfj, final Rotation cap) {
        return ((StateHolder<O, BlockState>)cfj).<Comparable, Integer>setValue((Property<Comparable>)SkullBlock.ROTATION, cap.rotate(cfj.<Integer>getValue((Property<Integer>)SkullBlock.ROTATION), 16));
    }
    
    @Override
    public BlockState mirror(final BlockState cfj, final Mirror bzj) {
        return ((StateHolder<O, BlockState>)cfj).<Comparable, Integer>setValue((Property<Comparable>)SkullBlock.ROTATION, bzj.mirror(cfj.<Integer>getValue((Property<Integer>)SkullBlock.ROTATION), 16));
    }
    
    @Override
    protected void createBlockStateDefinition(final StateDefinition.Builder<Block, BlockState> a) {
        a.add(SkullBlock.ROTATION);
    }
    
    static {
        ROTATION = BlockStateProperties.ROTATION_16;
        SHAPE = Block.box(4.0, 0.0, 4.0, 12.0, 8.0, 12.0);
    }
    
    public enum Types implements Type {
        SKELETON, 
        WITHER_SKELETON, 
        PLAYER, 
        ZOMBIE, 
        CREEPER, 
        DRAGON;
    }
    
    public interface Type {
    }
}
