Class FabricDataGenerator
java.lang.Object
net.minecraft.data.DataGenerator
net.fabricmc.fabric.api.datagen.v1.FabricDataGenerator
An extension to vanilla's
DataGenerator
providing mod specific data, and helper functions.-
Nested Class Summary
Nested classes/interfaces inherited from class net.minecraft.data.DataGenerator
DataGenerator.OutputType, DataGenerator.PathResolver
-
Constructor Summary
ConstructorsConstructorDescriptionFabricDataGenerator
(Path output, net.fabricmc.loader.api.ModContainer mod, boolean strictValidation) -
Method Summary
Modifier and TypeMethodDescription<P extends DataProvider>
PaddProvider
(boolean include, Function<FabricDataGenerator, P> provider) Helper overloaded method to aid with registering aDataProvider
that has a single argument constructor for aFabricDataGenerator
.<P extends DataProvider>
PaddProvider
(Function<FabricDataGenerator, P> provider) Helper overloaded method to aid with registering aDataProvider
that has a single argument constructor for aFabricDataGenerator
.void
addProvider
(DataProvider dataProvider) Helper overloaded method to aid with registering aDataProvider
.net.fabricmc.loader.api.ModContainer
Returns theModContainer
for the mod that this data generator has been created for.getModId()
Returns the mod ID for the mod that this data generator has been created for.boolean
When enabled data providers can do strict validation to ensure that all entries have data generated for them.Methods inherited from class net.minecraft.data.DataGenerator
addProvider, createPathResolver, getInputs, getOutput, resolveRootDirectoryPath, run
-
Constructor Details
-
FabricDataGenerator
@Internal public FabricDataGenerator(Path output, net.fabricmc.loader.api.ModContainer mod, boolean strictValidation)
-
-
Method Details
-
addProvider
Helper overloaded method to aid with registering aDataProvider
that has a single argument constructor for aFabricDataGenerator
.- Returns:
- The
DataProvider
-
addProvider
public <P extends DataProvider> P addProvider(boolean include, Function<FabricDataGenerator, P> provider) Helper overloaded method to aid with registering aDataProvider
that has a single argument constructor for aFabricDataGenerator
.- Returns:
- The
DataProvider
-
addProvider
Helper overloaded method to aid with registering aDataProvider
. -
getModContainer
public net.fabricmc.loader.api.ModContainer getModContainer()Returns theModContainer
for the mod that this data generator has been created for.- Returns:
- a
ModContainer
instance
-
getModId
Returns the mod ID for the mod that this data generator has been created for.- Returns:
- a mod ID
-
isStrictValidationEnabled
public boolean isStrictValidationEnabled()When enabled data providers can do strict validation to ensure that all entries have data generated for them.- Returns:
- if strict validation should be enabled
-