if you are looking for simple rotation, then stairs may not be the best example. Stairs rotate, but also can be placed upside down and their bounding boxes change.
1) add property facing to your block
public static final PropertyDirection FACING = BlockHorizontal.FACING;
2) set default blockstate in the block constructor
this.setDefaultState(this.blockState.getBaseState().withProperty(FACING, EnumFacing.NORTH));
3) create the proper blockstatecontainer
@Override
protected BlockStateContainer createBlockState() {
return new BlockStateContainer(this, new IProperty[] { FACING});
}
4) meta-> blockstate and blockstate->meta. a meta value is store with each blockstate. you have to convert this to and from the blockstate property value (below is taken from one of my blocks with other properties removed manually without testing, but think it is ok)
@Override
public IBlockState getStateFromMeta(int meta) {
EnumFacing enumfacing = EnumFacing.getFront(meta);
if (enumfacing.getAxis() == EnumFacing.Axis.Y)
{
enumfacing = EnumFacing.NORTH;
}
return this.getDefaultState().withProperty(FACING, enumfacing);
}
@Override
public int getMetaFromState(IBlockState state) {
EnumFacing facing=state.getValue(FACING);
int meta=((EnumFacing)state.getValue(FACING)).getIndex();
return meta;
}
5)set the property values in the blockstate json. (the "mod" is your modid, the "model" is your model json which should be located in assets/[mod]/models/block. If you wanted different models for different directions, just change here.
{
"variants": {
"facing=north": { "model": "mod:model" },
"facing=east": { "model": "mod:model", "y": 90 },
"facing=south": { "model": "mod:model", "y": 180 },
"facing=west": { "model": "mod:model", "y": 270 },
}
}
I think that is all you need. Good luck. Don't get discouraged modding, once you get used to looking into the minecraft code, it gets easier.