Interface DataGeneratorEntrypoint
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
An entry point for data generation.
In fabric.mod.json
, the entrypoint is defined with fabric-datagen
key.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptiondefault void
buildRegistry
(RegistryBuilder registryBuilder) Builds a registry containing dynamic registry entries to be generated.default @Nullable String
Returns the mod ID of the mod the data is being generated for.void
onInitializeDataGenerator
(FabricDataGenerator fabricDataGenerator) RegisterDataProvider
with theFabricDataGenerator
during this entrypoint.
-
Method Details
-
onInitializeDataGenerator
RegisterDataProvider
with theFabricDataGenerator
during this entrypoint.- Parameters:
fabricDataGenerator
- TheFabricDataGenerator
instance
-
getEffectiveModId
Returns the mod ID of the mod the data is being generated for. Anull
return will run the data generator using the mod ID that registered the current entrypoint.- Returns:
- a
String
ornull
- Throws:
RuntimeException
- If the mod ID does not exist.
-
buildRegistry
Builds a registry containing dynamic registry entries to be generated. Users should callRegistryBuilder.addRegistry(RegistryKey, RegistryBuilder.BootstrapFunction)
to register a bootstrap function, which adds registry entries to be generated.This is invoked asynchronously.
- Parameters:
registryBuilder
- aRegistryBuilder
instance
-