Class TransformedRecipeHandlerAdapter<R>

java.lang.Object
org.cyclops.commoncapabilities.capability.recipehandler.TransformedRecipeHandlerAdapter<R>
All Implemented Interfaces:
IRecipeHandler

public abstract class TransformedRecipeHandlerAdapter<R> extends Object implements IRecipeHandler
Abstract recipe handler based on transforming a recipe collection. It will also attempt to cache the transformed recipes.
  • Constructor Details

  • Method Details

    • isRecipeCacheEnabled

      protected boolean isRecipeCacheEnabled()
    • getRecipeCacheKey

      protected abstract String getRecipeCacheKey()
    • transformRecipe

      protected abstract IRecipeDefinition transformRecipe(R recipe)
    • findRecipe

      protected abstract R findRecipe(IMixedIngredients input)
    • getRecipesRaw

      protected abstract Collection<R> getRecipesRaw()
    • getRecipeInputComponents

      public Set<IngredientComponent<?,?>> getRecipeInputComponents()
      Specified by:
      getRecipeInputComponents in interface IRecipeHandler
      Returns:
      The input recipe component types that are possible for recipes in this handler.
    • getRecipeOutputComponents

      public Set<IngredientComponent<?,?>> getRecipeOutputComponents()
      Specified by:
      getRecipeOutputComponents in interface IRecipeHandler
      Returns:
      The output recipe component types that are possible for recipes in this handler.
    • getRecipes

      public Collection<IRecipeDefinition> getRecipes()
      Specified by:
      getRecipes in interface IRecipeHandler
      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

      @Nullable public IMixedIngredients simulate(IMixedIngredients input)
      Description copied from interface: IRecipeHandler
      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.
      Specified by:
      simulate in interface IRecipeHandler
      Parameters:
      input - A recipe input.
      Returns:
      The simulated output, or null if no valid recipe for the given input was found.