This is 1.12.2, we don't support 1.12.2 anymore.
If you have this issue with one of the support versions (currently 1.14.4 and 1.15.2) please provide a debug.log from one of those versions
Are you actually looking for the code or are you just saying so hoping for code handouts? Because if you think about what ToolMaterials represent it's rather obvious.