I’ve been working hard on a refactor this week, switching from my custom-made Python generation to Forge’s own data generation system. This is another one of those things I’ve been doing wrong since the beginning, and I’m finally getting around to correcting that mistake.
Although this refactor technically doesn’t add any new features to the mod, it does have a few advantages over my basic Python code:
- It uses code that other Forge/NeoForge developers will be familiar with, so it helps people use my code to learn or build new things.
- It checks if resources exist when it generates the data. I’ve had a few bugs where textures were missing, and Forge’s data generation will throw an error if you try to use a texture that doesn’t exist.
- It will automatically update the data format for you when you switch to a different Minecraft version, meaning a lot less custom code.
Of course, my python code isn’t completely useless. It is will still be used for image generation and code generation, two things that aren’t supported by Forge’s data generation.
So watch this space. Next week I’ll update on my progress and talk about how I’ve implemented data generation into Bok’s Banging Butterflies.