Class TransformedRecipeHandlerAdapter<R>
java.lang.Object
org.cyclops.commoncapabilities.capability.recipehandler.TransformedRecipeHandlerAdapter<R>
- All Implemented Interfaces:
IRecipeHandler
Abstract recipe handler based on transforming a recipe collection.
It will also attempt to cache the transformed recipes.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionTransformedRecipeHandlerAdapter(Set<IngredientComponent<?, ?>> inputComponents, Set<IngredientComponent<?, ?>> outputComponents) -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract RfindRecipe(IMixedIngredients input) protected abstract StringSet<IngredientComponent<?, ?>> Set<IngredientComponent<?, ?>> protected abstract Collection<R> protected booleansimulate(IMixedIngredients input) Test if the given recipe input can be handled by this handler.protected abstract IRecipeDefinitiontransformRecipe(R recipe) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.cyclops.commoncapabilities.api.capability.recipehandler.IRecipeHandler
isValidSizeInput, simulate
-
Field Details
-
CACHED_RECIPES
-
-
Constructor Details
-
TransformedRecipeHandlerAdapter
public TransformedRecipeHandlerAdapter(Set<IngredientComponent<?, ?>> inputComponents, Set<IngredientComponent<?, ?>> outputComponents)
-
-
Method Details
-
isRecipeCacheEnabled
protected boolean isRecipeCacheEnabled() -
getRecipeCacheKey
-
transformRecipe
-
findRecipe
-
getRecipesRaw
-
getRecipeInputComponents
- Specified by:
getRecipeInputComponentsin interfaceIRecipeHandler- Returns:
- The input recipe component types that are possible for recipes in this handler.
-
getRecipeOutputComponents
- Specified by:
getRecipeOutputComponentsin interfaceIRecipeHandler- Returns:
- The output recipe component types that are possible for recipes in this handler.
-
getRecipes
- Specified by:
getRecipesin interfaceIRecipeHandler- 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
Description copied from interface:IRecipeHandlerTest 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.- Specified by:
simulatein interfaceIRecipeHandler- Parameters:
input- A recipe input.- Returns:
- The simulated output, or null if no valid recipe for the given input was found.
-