You will have some errors. To fix most of them import the required libraries (ctrl + shift + o), idea users your on your own with that. The next errors are where my references are. I have a reference file for all the names and the blocks themselves. It is up to you to fix these (read the preface). It really is just replacing them with your references or string (the former allows for easier mass editing).
This was copied directly from my working code, so if it doesn't work, it is on your end and not me.
You may have noticed the IBlockState and are wondering what that is, read below.
I don't know.
From what I gathered from its name and code, it is an object that represents the blocks information. It seems to have a functional stairs, the code itself requires an IBlockState passed by the super. For my (and probably yours) purposes, you can leave all of it as is except the getBlock. For this just change the return to a reference to the block you want the block to look like.
Now the easy part is done. Time to make the json files.
Ok so you made the json files and placed the where they need to go (read preface)
Your json files conents will have to follow this format:
If you referenced other Jsons in you block state, they will have the same format.
And then save and run the game. It should be done.
There is only one flaw. These stairs will not transform into a corner piece. I believe this is not an error in this code, but because that is a different block altogether and requires different coding.
Actually...you just need to extend BlockStairs. In fact, you can just call the constructor for BlockStairs. The BlockStairs object is a fully implemented stair block that just needs a block state to base its properties on.
Block stairsMazewood = new BlockStairs(planksMazewood.getDefaultState())
An IBlockState is the Interface for block states. A block state is an object that stores IProperty's like "facing", "variant", etc.