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
FieldsFields inherited from interface net.minecraft.data.DataProvider
JSON_KEY_SORT_ORDER, JSON_KEY_SORTING_COMPARATOR, LOGGER -
Constructor Summary
ConstructorsConstructorDescriptionFabricRecipeProvider(FabricDataOutput output, CompletableFuture<RegistryWrapper.WrapperLookup> registriesFuture) -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract RecipeGeneratorgetRecipeGenerator(RegistryWrapper.WrapperLookup registryLookup, RecipeExporter exporter) Implement this method and then use the range of methods inRecipeGeneratoror from one of the recipe json factories such asShapedRecipeJsonBuilderorShapelessRecipeJsonBuilder.protected IdentifiergetRecipeIdentifier(Identifier identifier) Override this method to change the recipe identifier.run(DataWriter writer) protected RecipeExporterwithConditions(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, waitMethods 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 inRecipeGeneratoror from one of the recipe json factories such asShapedRecipeJsonBuilderorShapelessRecipeJsonBuilder.- Specified by:
getRecipeGeneratorin classRecipeGenerator.RecipeProvider
-
withConditions
Return a new exporter that applies the specified conditions to any recipe json provider it receives. -
run
- Specified by:
runin interfaceDataProvider- Overrides:
runin classRecipeGenerator.RecipeProvider
-
getRecipeIdentifier
Override this method to change the recipe identifier. The default implementation normalizes the namespace to the mod ID.
-