So I currently have my block class setup and wanted my block to change face based on its direction no big deal, but I also use the same class to register different blocks via Enum values, basically I am trying to return 2 blockstates and wondered if it was possible. Because currently I can get it to rotate, but all blocks have same texture, otherwise i can get it to have different textures but then it no longer rotates
public class BlockTier extends Block{
public static final PropertyEnum<EnumTier> TIER = PropertyEnum.create("tier", EnumTier.class);
public static final IProperty<EnumFacing> FACING = BlockHorizontal.FACING;
public BlockTier(Material m, MapColor c) {
super(m, c);
}
@Nonnull
@Override
protected BlockStateContainer createBlockState() {
return new BlockStateContainer(this, TIER, FACING);
}
@Override
@Deprecated
public IBlockState getStateFromMeta(int meta){
return this.getDefaultState().withProperty(FACING, EnumFacing.byHorizontalIndex(meta)).withProperty(TIER, EnumTier.byMeta(meta));
//FIXED
}
@Override
public int getMetaFromState(IBlockState state){
return state.getValue(TIER).ordinal() + state.getValue(FACING).getHorizontalIndex();
}
@Override
public boolean hasTileEntity(IBlockState state){
return true;
}
@Override
public int damageDropped(IBlockState state){
return state.getValue(TIER).ordinal();
}
@Override
public void getSubBlocks(CreativeTabs itemIn, NonNullList<ItemStack> items){
for (EnumTier tier : EnumTier.VALUES){
items.add(new ItemStack(this, 1, tier.ordinal()));
}
}
@Nonnull
@Override
public IBlockState getStateForPlacement(@Nonnull World world, @Nonnull BlockPos pos, @Nonnull EnumFacing facing, float hitX, float hitY, float hitZ, int meta, @Nonnull EntityLivingBase placer, EnumHand hand){
return getStateFromMeta(meta).withProperty(FACING, placer.getHorizontalFacing().getOpposite());
}