Class AbstractCookingRecipe

java.lang.Object
net.minecraft.recipe.AbstractCookingRecipe
All Implemented Interfaces:
Recipe<Inventory>
Direct Known Subclasses:
BlastingRecipe, CampfireCookingRecipe, SmeltingRecipe, SmokingRecipe

public abstract class AbstractCookingRecipe
extends Object
implements Recipe<Inventory>
  • Field Details

    • type

      protected final RecipeType<?> type
    • id

      protected final Identifier id
    • group

      protected final String group
    • input

      protected final Ingredient input
    • output

      protected final ItemStack output
    • experience

      protected final float experience
    • cookTime

      protected final int cookTime
  • Constructor Details

  • Method Details

    • matches

      public boolean matches​(Inventory inventory, World world)
      Determines whether this recipe matches the contents currently placed inside the available crafting grid.
      Specified by:
      matches in interface Recipe<Inventory>
    • craft

      public ItemStack craft​(Inventory inventory)
      Crafts this recipe.

      This method may perform side effects on the inventory argument.

      This method should return a new item stack on each call.

      Specified by:
      craft in interface Recipe<Inventory>
      Returns:
      the resulting item stack
    • fits

      @Environment(CLIENT) public boolean fits​(int width, int height)
      Determines whether this recipe's pattern will fit into the available crafting area.
      Specified by:
      fits in interface Recipe<Inventory>
    • getIngredients

      public DefaultedList<Ingredient> getIngredients()
      The ingredients accepted as inputs for this recipe. Used by the recipe book when displaying a ghost form of this recipe on the crafting grid as well as for previewing the possible inputs in the book itself.
      Specified by:
      getIngredients in interface Recipe<Inventory>
    • getExperience

      public float getExperience()
    • getOutput

      public ItemStack getOutput()
      Specified by:
      getOutput in interface Recipe<Inventory>
    • getGroup

      @Environment(CLIENT) public String getGroup()
      Optional group this recipe belongs in. Used to group recipes into different categories by the recipe book.
      Specified by:
      getGroup in interface Recipe<Inventory>
    • getCookTime

      public int getCookTime()
    • getId

      public Identifier getId()
      Specified by:
      getId in interface Recipe<Inventory>
    • getType

      public RecipeType<?> getType()
      Specified by:
      getType in interface Recipe<Inventory>