Class RecipeDefinition
java.lang.Object
org.cyclops.commoncapabilities.api.capability.recipehandler.RecipeDefinition
- All Implemented Interfaces:
Comparable<IRecipeDefinition>
,IRecipeDefinition
A recipe definition based on maps.
-
Constructor Summary
ConstructorDescriptionRecipeDefinition
(Map<IngredientComponent<?, ?>, List<IPrototypedIngredientAlternatives<?, ?>>> inputs, IMixedIngredients output) -
Method Summary
Modifier and TypeMethodDescriptionint
compareTo
(IRecipeDefinition that) boolean
Set<IngredientComponent<?,
?>> <T,
M> List<IPrototypedIngredientAlternatives<T, M>> getInputs
(IngredientComponent<T, M> ingredientComponent) Get the input prototypes of a certain type.int
hashCode()
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.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.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.toString()
-
Constructor Details
-
RecipeDefinition
public RecipeDefinition(Map<IngredientComponent<?, ?>, List<IPrototypedIngredientAlternatives<?, ?>>> inputs, IMixedIngredients output)
-
-
Method Details
-
getInputComponents
- Specified by:
getInputComponents
in interfaceIRecipeDefinition
- 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 interfaceIRecipeDefinition
- Type Parameters:
T
- The instance type.M
- The matching condition parameter, may be Void.- Parameters:
ingredientComponent
- An ingredient component type.- Returns:
- Input prototypes.
-
getOutput
- Specified by:
getOutput
in interfaceIRecipeDefinition
- Returns:
- The output ingredients.
-
equals
-
hashCode
public int hashCode() -
toString
-
ofAlternatives
public static <T,R, RecipeDefinition ofAlternativesM> (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, RecipeDefinition ofIngredientsM> (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, RecipeDefinition ofIngredientM> (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
- Specified by:
compareTo
in interfaceComparable<IRecipeDefinition>
-