Class FabricDataGenerator
java.lang.Object
net.minecraft.data.DataGenerator
net.fabricmc.fabric.api.datagen.v1.FabricDataGenerator
public final class FabricDataGenerator
extends net.minecraft.data.DataGenerator
An extension to vanilla's
DataGenerator
providing mod specific data, and helper functions.-
Constructor Summary
ConstructorsConstructorDescriptionFabricDataGenerator
(Path output, net.fabricmc.loader.api.ModContainer mod, boolean strictValidation) -
Method Summary
Modifier and TypeMethodDescription<P extends net.minecraft.data.DataProvider>
PaddProvider
(Function<FabricDataGenerator, P> provider) Helper overloaded method to aid with registering aDataProvider
that has a single argument constructor for aFabricDataGenerator
.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, getInputs, getOutput, run
-
Constructor Details
-
FabricDataGenerator
@Internal public FabricDataGenerator(Path output, net.fabricmc.loader.api.ModContainer mod, boolean strictValidation)
-
-
Method Details
-
addProvider
public <P extends net.minecraft.data.DataProvider> P addProvider(Function<FabricDataGenerator, P> provider) Helper overloaded method to aid with registering aDataProvider
that has a single argument constructor for aFabricDataGenerator
.- Returns:
- The
DataProvider
-
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
-