Class FabricRecipeProvider
java.lang.Object
net.minecraft.data.recipe.RecipeGenerator.RecipeProvider
net.fabricmc.fabric.api.datagen.v1.provider.FabricRecipeProvider
- All Implemented Interfaces:
DataProvider
Extend this class and implement
getRecipeGenerator(net.minecraft.registry.RegistryWrapper.WrapperLookup, net.minecraft.data.recipe.RecipeExporter)
.
Register an instance of the class with FabricDataGenerator.Pack.addProvider(net.fabricmc.fabric.api.datagen.v1.FabricDataGenerator.Pack.Factory<T>)
in a DataGeneratorEntrypoint
.
-
Nested Class Summary
Nested classes/interfaces inherited from interface net.minecraft.data.DataProvider
DataProvider.Factory<T extends DataProvider>
-
Field Summary
Fields inherited from interface net.minecraft.data.DataProvider
JSON_KEY_SORT_ORDER, JSON_KEY_SORTING_COMPARATOR, LOGGER
-
Constructor Summary
ConstructorDescriptionFabricRecipeProvider
(FabricDataOutput output, CompletableFuture<RegistryWrapper.WrapperLookup> registriesFuture) -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract RecipeGenerator
getRecipeGenerator
(RegistryWrapper.WrapperLookup registryLookup, RecipeExporter exporter) Implement this method and then use the range of methods inRecipeGenerator
or from one of the recipe json factories such asShapedRecipeJsonBuilder
orShapelessRecipeJsonBuilder
.protected Identifier
getRecipeIdentifier
(Identifier identifier) Override this method to change the recipe identifier.run
(DataWriter writer) protected RecipeExporter
withConditions
(RecipeExporter exporter, ResourceCondition... conditions) Return a new exporter that applies the specified conditions to any recipe json provider it receives.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface net.minecraft.data.DataProvider
getName
-
Field Details
-
output
-
-
Constructor Details
-
FabricRecipeProvider
public FabricRecipeProvider(FabricDataOutput output, CompletableFuture<RegistryWrapper.WrapperLookup> registriesFuture)
-
-
Method Details
-
getRecipeGenerator
protected abstract RecipeGenerator getRecipeGenerator(RegistryWrapper.WrapperLookup registryLookup, RecipeExporter exporter) Implement this method and then use the range of methods inRecipeGenerator
or from one of the recipe json factories such asShapedRecipeJsonBuilder
orShapelessRecipeJsonBuilder
.- Specified by:
getRecipeGenerator
in classRecipeGenerator.RecipeProvider
-
withConditions
Return a new exporter that applies the specified conditions to any recipe json provider it receives. -
run
- Specified by:
run
in interfaceDataProvider
- Overrides:
run
in classRecipeGenerator.RecipeProvider
-
getRecipeIdentifier
Override this method to change the recipe identifier. The default implementation normalizes the namespace to the mod ID.
-