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 Summary
ConstructorDescriptionRecipeHandlerRecipeType
(Supplier<net.minecraft.world.level.Level> worldSupplier, net.minecraft.world.item.crafting.RecipeType<R> recipeType, Set<IngredientComponent<?, ?>> inputComponents, Set<IngredientComponent<?, ?>> outputComponents) -
Method Summary
Modifier and TypeMethodDescriptiongetRecipeDefinition
(net.minecraft.world.item.crafting.RecipeHolder<R> recipe) Set<IngredientComponent<?,
?>> protected abstract C
getRecipeInputContainer
(IMixedIngredients recipeInput) Create a new container for the given recipe's input.protected abstract Map<IngredientComponent<?,
?>, List<IPrototypedIngredientAlternatives<?, ?>>> getRecipeInputIngredients
(R recipe) Get the input ingredients for the given recipe.Set<IngredientComponent<?,
?>> protected abstract IMixedIngredients
getRecipeOutputIngredients
(R recipe) Get the output ingredients for the given recipe.simulate
(IMixedIngredients input) Test if the given recipe input can be handled by this handler.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.cyclops.commoncapabilities.api.capability.recipehandler.IRecipeHandler
isValidSizeInput
-
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
- Specified by:
getRecipeInputComponents
in interfaceIRecipeHandler
- Returns:
- The input recipe component types that are possible for recipes in this handler.
-
getRecipeOutputComponents
- Specified by:
getRecipeOutputComponents
in interfaceIRecipeHandler
- Returns:
- The output recipe component types that are possible for recipes in this handler.
-
getRecipes
- Specified by:
getRecipes
in 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.
-
getRecipeDefinition
@Nullable public IRecipeDefinition getRecipeDefinition(net.minecraft.world.item.crafting.RecipeHolder<R> recipe) -
simulate
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 interfaceIRecipeHandler
- Parameters:
input
- A recipe input.- Returns:
- The simulated output, or null if no valid recipe for the given input was found.
-
getRecipeInputContainer
Create a new container for the given recipe's input.- Parameters:
recipeInput
- A recipe input.- Returns:
- A container.
-
getRecipeInputIngredients
@Nullable protected abstract Map<IngredientComponent<?,?>, getRecipeInputIngredientsList<IPrototypedIngredientAlternatives<?, ?>>> (R recipe) Get the input ingredients for the given recipe.- Parameters:
recipe
- A recipe.- Returns:
- Input ingredients.
-
getRecipeOutputIngredients
Get the output ingredients for the given recipe.- Parameters:
recipe
- A recipe.- Returns:
- Output ingredients.
-