Class FabricRecipeProvider
java.lang.Object
net.minecraft.data.server.RecipeProvider
net.fabricmc.fabric.api.datagen.v1.provider.FabricRecipeProvider
- All Implemented Interfaces:
net.minecraft.data.DataProvider
- Direct Known Subclasses:
FabricRecipesProvider
public abstract class FabricRecipeProvider
extends net.minecraft.data.server.RecipeProvider
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
Fields inherited from interface net.minecraft.data.DataProvider
SHA1
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected abstract void
generateRecipes
(Consumer<net.minecraft.data.server.recipe.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 net.minecraft.util.Identifier
getRecipeIdentifier
(net.minecraft.util.Identifier identifier) Override this method to change the recipe identifier.void
run
(net.minecraft.data.DataCache cache) protected Consumer<net.minecraft.data.server.recipe.RecipeJsonProvider>
withConditions
(Consumer<net.minecraft.data.server.recipe.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
protected abstract void generateRecipes(Consumer<net.minecraft.data.server.recipe.RecipeJsonProvider> exporter) 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<net.minecraft.data.server.recipe.RecipeJsonProvider> withConditions(Consumer<net.minecraft.data.server.recipe.RecipeJsonProvider> exporter, ConditionJsonProvider... conditions) Return a new exporter that applies the specified conditions to any recipe json provider it receives. -
run
public void run(net.minecraft.data.DataCache cache) - Specified by:
run
in interfacenet.minecraft.data.DataProvider
- Overrides:
run
in classnet.minecraft.data.server.RecipeProvider
-
getRecipeIdentifier
protected net.minecraft.util.Identifier getRecipeIdentifier(net.minecraft.util.Identifier identifier) Override this method to change the recipe identifier. The default implementation normalizes the namespace to the mod ID.
-