@jabelar, thanks. WorldPainter (which is not a mod) has existed since 2011 and you can still load world files from back then, and it can still export worlds to Minecraft 1.1 (not a typo), so I know a little bit about versioning, converting block IDs, etc.
I want to use registry names within a version, but I also want to correlate them to the block IDs and data values of previous versions, for various valid reasons which I've tried to explain, and are of no relevance here anyway. I'm only using Forge temporarily in order to get this information from Minecraft.
None of this is relevant to my actual question, which has nothing to do with integers, converters, etc.. I just gave this information for background, which I can now see was a mistake. I'm also not looking for programming advice. Would it be possible for someone to address the question I'm actually asking? Many thanks in advance!