Interface DataGenerationConstructor
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
A mod's data generation entry point, written once in common code. It's only created when data is generated, so
providers may use client-only classes (models...).
Hooking it up:
- Fabric: list the class under the
"coolcatlib:datagen"entrypoint, andnet.ixdarklord.coolcatcore.api.core.fabric.FabricDataGenerationEntrypointunder"fabric-datagen". - Forge:
dataGeneration(MyModData::new)in aForgeModEntrypoint. - Anywhere else:
construct(String, Supplier)while mods are constructed.
-
Method Summary
Modifier and TypeMethodDescriptionstatic voidconstruct(String modId, Supplier<? extends DataGenerationConstructor> factory) Registers a mod's data generation entry point.voidonGatherData(DataGenerationContext context) Adds the mod's data providers.
-
Method Details
-
construct
Registers a mod's data generation entry point. The factory is only called when data is generated for that mod. -
onGatherData
Adds the mod's data providers.
-