Data generation
DataGenRuns lets a mod’s Fabric data generator run end on its own once it has written its
files, in place of a shutdown thread of the mod’s own.
At a glance
Section titled “At a glance”| Type | Summary | Status | Since | Side | Thread |
|---|---|---|---|---|---|
DataGenRuns |
Ends a Fabric data generator run once it has finished. | Experimental | 2.8.0 | both | setup |
Quick start
Section titled “Quick start”In your mod’s data generator entry point, with MapleLangProvider, one of the mod’s providers:
@Overridepublic void onInitializeDataGenerator(FabricDataGenerator generator) { DataGenRuns.exitWhenFinished("mymod"); FabricDataGenerator.Pack pack = generator.createPack(); pack.addProvider(MapleLangProvider::new);}DataGenRuns
Section titled “DataGenRuns”Experimental · Since 2.8.0 · Side: both · Thread: setup
- Fabric API runs only the data generator entry points of the mod that
fabric-api.datagen.modidnames. When the providers live in a separate development-only mod,DataGenRuns#exitWhenFinishedgoes in that mod’s entry point, the one that runs.
See also
Section titled “See also”- Advancements: writing advancement files from the same data generator.