Fabric API

Fabric API

106M Downloads

First-class support for data generators

williewillus opened this issue ยท 3 comments

commented

Vanilla has data generators located at an alternate entrypoint net.minecraft.data.Main::main.

These are used to generate all of the game's data in a uniform, consistent, cacheable, and error-safe manner.

This ticket is to request support for an extra way to launch the game (in dev) that goes to this alternate main method. Vanilla bootstraps the registry before running the generators, so I imagine something like bootstrapping the registry, then running all modinitializers + clientmodinitializers, then run the generators. This might require some loader support as well?

Forge has first-class support for this, and I believe we shouldn't be afraid of taking things that work. It's much better and less manual than e.g. having to enter a game and run a command to generate things. It's absolutely indispensable for large mods like Botania with lots of assets and data, so hopefully this can be considered.

commented

This has now been done. ๐Ÿ‘

commented

After seeing this as resolved, I tried to run fabric server with both:
java -DbundlerMainClass=net.minecraft.data.Main -jar fabric-server-launch.jar
and
java -cp fabric-server-launch.jar net.minecraft.data.Main

The first one simply started the server but did not export any data.
The second one crashed with a ClassNotFoundException.

How do you run the data generator on a Fabric server?

commented

I feel this would be quite useful. Wrt vanilla builtin data generators, we cannot use fabric item/block settings by just running a main method and calling the generators. For those classes we either need a debug mode for em or apply mixins before that.