package com.pahimar.ee.block; import com.pahimar.ee.block.base.BlockBase; import net.minecraft.block.properties.PropertyDirection; import net.minecraft.block.state.BlockStateContainer; import net.minecraft.block.state.IBlockState; import net.minecraft.entity.EntityLivingBase; import net.minecraft.util.EnumFacing; import net.minecraft.util.EnumHand; import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; public class BlockInfusedStoneSlab extends BlockBase { public static final PropertyDirection FACING = PropertyDirection.create("facing"); public BlockInfusedStoneSlab() { super("infused_stone_slab"); setDefaultState(blockState.getBaseState().withProperty(FACING, EnumFacing.UP)); } @Override public IBlockState getStateFromMeta(int meta) { return getDefaultState().withProperty(FACING, EnumFacing.getFront(meta & 7)); } @Override public int getMetaFromState(IBlockState state) { return state.getValue(FACING).getIndex(); } @Override protected BlockStateContainer createBlockState() { return new BlockStateContainer(this, FACING); } @Override public IBlockState getStateForPlacement(World worldIn, BlockPos pos, EnumFacing facing, float hitX, float hitY, float hitZ, int meta, EntityLivingBase placer, EnumHand hand) { return this.getDefaultState().withProperty(FACING, facing); } }