Class RecipeHandlerRecipeType<C extends net.minecraft.world.Container,R extends net.minecraft.world.item.crafting.Recipe<C>>

java.lang.Object
org.cyclops.cyclopscore.ingredient.recipe.RecipeHandlerRecipeType<C,R>
All Implemented Interfaces:
IRecipeHandler

public abstract class RecipeHandlerRecipeType<C extends net.minecraft.world.Container,R extends net.minecraft.world.item.crafting.Recipe<C>> extends Object implements IRecipeHandler
A recipe handler that handles RecipeType.
  • Constructor Details

    • RecipeHandlerRecipeType

      public RecipeHandlerRecipeType(Supplier<net.minecraft.world.level.Level> worldSupplier, net.minecraft.world.item.crafting.RecipeType<R> recipeType, Set<IngredientComponent<?,?>> inputComponents, Set<IngredientComponent<?,?>> outputComponents)
  • Method Details

    • 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.
    • getRecipeDefinition

      @Nullable public IRecipeDefinition getRecipeDefinition(net.minecraft.world.item.crafting.RecipeHolder<R> recipe)
    • 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.
    • getRecipeInputContainer

      @Nullable protected abstract C getRecipeInputContainer(IMixedIngredients recipeInput)
      Create a new container for the given recipe's input.
      Parameters:
      recipeInput - A recipe input.
      Returns:
      A container.
    • getRecipeInputIngredients

      @Nullable protected abstract Map<IngredientComponent<?,?>,List<IPrototypedIngredientAlternatives<?,?>>> getRecipeInputIngredients(R recipe)
      Get the input ingredients for the given recipe.
      Parameters:
      recipe - A recipe.
      Returns:
      Input ingredients.
    • getRecipeOutputIngredients

      @Nullable protected abstract IMixedIngredients getRecipeOutputIngredients(R recipe)
      Get the output ingredients for the given recipe.
      Parameters:
      recipe - A recipe.
      Returns:
      Output ingredients.