All Superinterfaces:
Comparable<IRecipeDefinition>
All Known Implementing Classes:
RecipeDefinition

public interface IRecipeDefinition extends Comparable<IRecipeDefinition>
Defines the inputs and outputs of a recipe. Inputs are ingredient prototypes for ingredient component types. Outputs are exact instances for ingredient component types. Implementing classes should properly implement the equals and hashCode methods.
  • Method Details

    • getInputComponents

      Set<IngredientComponent<?,?>> getInputComponents()
      Returns:
      The input ingredient component types.
    • getInputs

      <T, M> List<IPrototypedIngredientAlternatives<T,M>> getInputs(IngredientComponent<T,M> ingredientComponent)
      Get the input prototypes of a certain type. The first list contains a list of ingredients, whereas the deeper second list contains different prototype-based alternatives for the ingredient at this position.
      Type Parameters:
      T - The instance type.
      M - The matching condition parameter, may be Void.
      Parameters:
      ingredientComponent - An ingredient component type.
      Returns:
      Input prototypes.
    • getOutput

      IMixedIngredients getOutput()
      Returns:
      The output ingredients.
    • serialize

      static net.minecraft.nbt.CompoundTag serialize(IRecipeDefinition recipe)
      Deserialize a recipe to NBT.
      Parameters:
      recipe - A recipe.
      Returns:
      An NBT representation of the given recipe.
    • deserialize

      static RecipeDefinition deserialize(net.minecraft.nbt.CompoundTag tag) throws IllegalArgumentException
      Deserialize a recipe from NBT
      Parameters:
      tag - An NBT tag.
      Returns:
      A new mixed recipe instance.
      Throws:
      IllegalArgumentException - If the given tag is invalid or does not contain data on the given recipe.