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

    Constructors
    Constructor
    Description
    RaccoonSpecialRecipeBuilder(net.minecraft.world.item.crafting.RecipeSerializer<?> serializer)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    save(@NotNull Consumer<net.minecraft.data.recipes.FinishedRecipe> consumer, @NotNull String recipeId)
    Saves the special recipe using the given recipe ID.
    void
    save(Consumer<net.minecraft.data.recipes.FinishedRecipe> consumer, net.minecraft.resources.ResourceLocation recipeId)
    Saves the special recipe using the given recipe ID.
    special(@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

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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 criterion
      criterion - 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:
      save in class net.minecraft.data.recipes.SpecialRecipeBuilder
      Parameters:
      consumer - the recipe output consumer
      recipeId - 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 consumer
      recipeId - the recipe ID