Interface IRecipeHandler
- All Known Implementing Classes:
DefaultRecipeHandler
,TransformedRecipeHandlerAdapter
,VanillaBrewingStandRecipeHandler
,VanillaRecipeTypeRecipeHandler
public interface IRecipeHandler
An IRecipeHandler is able to process recipes.
It is used to expose the possible recipes the target can handle,
and simulate what output will be produced based on a certain input.
It may also expose further information on how the inputs and outputs
must be handled.
-
Method Summary
Modifier and TypeMethodDescriptionSet
<IngredientComponent<?, ?>> Set
<IngredientComponent<?, ?>> boolean
isValidSizeInput
(IngredientComponent<?, ?> component, int size) Check if the given size of recipe component instances are valid for the given recipe component type.simulate
(IMixedIngredients input) Test if the given recipe input can be handled by this handler.
-
Method Details
-
getRecipeInputComponents
Set<IngredientComponent<?,?>> getRecipeInputComponents()- Returns:
- The input recipe component types that are possible for recipes in this handler.
-
getRecipeOutputComponents
Set<IngredientComponent<?,?>> getRecipeOutputComponents()- Returns:
- The output recipe component types that are possible for recipes in this handler.
-
isValidSizeInput
Check if the given size of recipe component instances are valid for the given recipe component type.- Parameters:
component
- The component type.size
- A certain length of recipe component instances.- Returns:
- If the given size of recipe component instances can be used by this recipe handler.
-
getRecipes
Collection<IRecipeDefinition> getRecipes()- Returns:
- Recipes that are available through this handler, this list is not necessarily exhaustive, but SHOULD be. No consistent order should be assumed from in collection.
-
simulate
Test if the given recipe input can be handled by this handler. This method is mainly meant to be indicative. No actual crafting processes should be crafted because of this, i.e., calling this method should not have any effects on the state of this recipe handler.- Parameters:
input
- A recipe input.- Returns:
- The simulated output, or null if no valid recipe for the given input was found.
-