java.lang.Object
org.cyclops.commoncapabilities.api.capability.recipehandler.RecipeDefinition
All Implemented Interfaces:
Comparable<IRecipeDefinition>, IRecipeDefinition

public class RecipeDefinition extends Object implements IRecipeDefinition
A recipe definition based on maps.
  • Constructor Details

  • Method Details

    • getInputComponents

      public Set<IngredientComponent<?,?>> getInputComponents()
      Specified by:
      getInputComponents in interface IRecipeDefinition
      Returns:
      The input ingredient component types.
    • getInputs

      public <T, M> List<IPrototypedIngredientAlternatives<T,M>> getInputs(IngredientComponent<T,M> ingredientComponent)
      Description copied from interface: IRecipeDefinition
      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.
      Specified by:
      getInputs in interface IRecipeDefinition
      Type Parameters:
      T - The instance type.
      M - The matching condition parameter, may be Void.
      Parameters:
      ingredientComponent - An ingredient component type.
      Returns:
      Input prototypes.
    • getOutput

      public IMixedIngredients getOutput()
      Specified by:
      getOutput in interface IRecipeDefinition
      Returns:
      The output ingredients.
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • ofAlternatives

      public static <T, R, M> RecipeDefinition ofAlternatives(IngredientComponent<T,M> component, List<IPrototypedIngredientAlternatives<T,M>> alternatives, IMixedIngredients output)
      Create a new recipe definition for a single component type input and a list of alternatives.
      Type Parameters:
      T - The instance type.
      R - The recipe target type, may be Void.
      M - The matching condition parameter, may be Void.
      Parameters:
      component - A component type.
      alternatives - The alternatives for the given component type.
      output - The recipe output.
      Returns:
      A new recipe definition.
    • ofIngredients

      public static <T, R, M> RecipeDefinition ofIngredients(IngredientComponent<T,M> component, List<List<IPrototypedIngredient<T,M>>> ingredients, IMixedIngredients output)
      Create a new recipe definition for a single component type input and a list of instances.
      Type Parameters:
      T - The instance type.
      R - The recipe target type, may be Void.
      M - The matching condition parameter, may be Void.
      Parameters:
      component - A component type.
      ingredients - The ingredients for the given component type.
      output - The recipe output.
      Returns:
      A new recipe definition.
    • ofIngredient

      public static <T, R, M> RecipeDefinition ofIngredient(IngredientComponent<T,M> component, List<IPrototypedIngredient<T,M>> ingredient, IMixedIngredients output)
      Create a new recipe definittion for a single component type input and a single instance.
      Type Parameters:
      T - The instance type.
      R - The recipe target type, may be Void.
      M - The matching condition parameter, may be Void.
      Parameters:
      component - A component type.
      ingredient - An ingredient for the given component type.
      output - The recipe output.
      Returns:
      A new recipe definition.
    • compareTo

      public int compareTo(IRecipeDefinition that)
      Specified by:
      compareTo in interface Comparable<IRecipeDefinition>