Package net.kamkeyke.raccooncore.datagen
Class RaccoonSpecialRecipeBuilder
java.lang.Object
net.minecraft.data.recipes.CraftingRecipeBuilder
net.minecraft.data.recipes.SpecialRecipeBuilder
net.kamkeyke.raccooncore.datagen.RaccoonSpecialRecipeBuilder
public class RaccoonSpecialRecipeBuilder
extends net.minecraft.data.recipes.SpecialRecipeBuilder
A
SpecialRecipeBuilder with support for recipe unlock advancements.
This builder behaves similarly to vanilla recipe builders such as
ShapedRecipeBuilder, while supporting dynamic/special crafting
recipes.
Unlike vanilla SpecialRecipeBuilder, this builder allows
unlockedBy(String, CriterionTriggerInstance) criteria to be added
and automatically generates the corresponding recipe advancement.
- Since:
- 2.6.0
-
Nested Class Summary
Nested classes/interfaces inherited from class net.minecraft.data.recipes.CraftingRecipeBuilder
net.minecraft.data.recipes.CraftingRecipeBuilder.CraftingResult -
Constructor Summary
ConstructorsConstructorDescriptionRaccoonSpecialRecipeBuilder(net.minecraft.world.item.crafting.RecipeSerializer<?> serializer) -
Method Summary
Modifier and TypeMethodDescriptionvoidsave(@NotNull Consumer<net.minecraft.data.recipes.FinishedRecipe> consumer, @NotNull String recipeId) Saves the special recipe using the given recipe ID.voidsave(Consumer<net.minecraft.data.recipes.FinishedRecipe> consumer, net.minecraft.resources.ResourceLocation recipeId) Saves the special recipe using the given recipe ID.static RaccoonSpecialRecipeBuilderspecial(@NotNull net.minecraft.world.item.crafting.RecipeSerializer<? extends net.minecraft.world.item.crafting.CraftingRecipe> serializer) Creates a new special recipe builder.unlockedBy(String criterionName, net.minecraft.advancements.CriterionTriggerInstance criterion) Adds an advancement criterion required to unlock the recipe.Methods inherited from class net.minecraft.data.recipes.CraftingRecipeBuilder
determineBookCategory
-
Constructor Details
-
RaccoonSpecialRecipeBuilder
public RaccoonSpecialRecipeBuilder(net.minecraft.world.item.crafting.RecipeSerializer<?> serializer)
-
-
Method Details
-
special
public static RaccoonSpecialRecipeBuilder special(@NotNull @NotNull net.minecraft.world.item.crafting.RecipeSerializer<? extends net.minecraft.world.item.crafting.CraftingRecipe> serializer) Creates a new special recipe builder.- Parameters:
serializer- the serializer for the special recipe- Returns:
- a new builder
-
unlockedBy
public RaccoonSpecialRecipeBuilder unlockedBy(String criterionName, net.minecraft.advancements.CriterionTriggerInstance criterion) Adds an advancement criterion required to unlock the recipe.- Parameters:
criterionName- the name of the criterioncriterion- the criterion trigger- Returns:
- this builder
-
save
public void save(@NotNull @NotNull Consumer<net.minecraft.data.recipes.FinishedRecipe> consumer, @NotNull @NotNull String recipeId) Saves the special recipe using the given recipe ID.The recipe ID must include a namespace, for example:
"heartpouch:heartstone_pouch_from_wool".- Overrides:
savein classnet.minecraft.data.recipes.SpecialRecipeBuilder- Parameters:
consumer- the recipe output consumerrecipeId- the recipe ID
-
save
public void save(Consumer<net.minecraft.data.recipes.FinishedRecipe> consumer, net.minecraft.resources.ResourceLocation recipeId) Saves the special recipe using the given recipe ID.- Parameters:
consumer- the recipe output consumerrecipeId- the recipe ID
-