Class FabricRecipeProvider
java.lang.Object
net.minecraft.data.server.RecipeProvider
net.fabricmc.fabric.api.datagen.v1.provider.FabricRecipeProvider
- All Implemented Interfaces:
DataProvider
Extend this class and implement
generateRecipes(java.util.function.Consumer<net.minecraft.data.server.recipe.RecipeJsonProvider>)
.
Register an instance of the class with FabricDataGenerator.addProvider(java.util.function.Function<net.fabricmc.fabric.api.datagen.v1.FabricDataGenerator, P>)
in a DataGeneratorEntrypoint
-
Field Summary
FieldsFields inherited from interface net.minecraft.data.DataProvider
JSON_KEY_SORT_ORDER, JSON_KEY_SORTING_COMPARATOR
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract void
generateRecipes
(Consumer<RecipeJsonProvider> exporter) Implement this method and then use the range of methods inRecipeProvider
or from one of the recipe json factories such asShapedRecipeJsonBuilder
orShapelessRecipeJsonBuilder
.protected Identifier
getRecipeIdentifier
(Identifier identifier) Override this method to change the recipe identifier.void
run
(DataWriter writer) protected Consumer<RecipeJsonProvider>
withConditions
(Consumer<RecipeJsonProvider> exporter, ConditionJsonProvider... conditions) Return a new exporter that applies the specified conditions to any recipe json provider it receives.Methods inherited from class net.minecraft.data.server.RecipeProvider
createChiseledBlockRecipe, createCondensingRecipe, createCutCopperRecipe, getName, getWallRecipe, offerCandleDyeingRecipe, offerChiseledBlockRecipe, offerCutCopperRecipe, offerPolishedStoneRecipe, offerWallRecipe
-
Field Details
-
dataGenerator
-
-
Constructor Details
-
FabricRecipeProvider
-
-
Method Details
-
generateRecipes
Implement this method and then use the range of methods inRecipeProvider
or from one of the recipe json factories such asShapedRecipeJsonBuilder
orShapelessRecipeJsonBuilder
. -
withConditions
protected Consumer<RecipeJsonProvider> withConditions(Consumer<RecipeJsonProvider> exporter, ConditionJsonProvider... conditions) 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 classRecipeProvider
-
getRecipeIdentifier
Override this method to change the recipe identifier. The default implementation normalizes the namespace to the mod ID.
-