Class VanillaRecipeTypeRecipeHandler<C extends net.minecraft.world.item.crafting.RecipeInput,T extends net.minecraft.world.item.crafting.Recipe<C>>
java.lang.Object
org.cyclops.commoncapabilities.modcompat.vanilla.capability.recipehandler.VanillaRecipeTypeRecipeHandler<C,T>
- All Implemented Interfaces:
IRecipeHandler
public class VanillaRecipeTypeRecipeHandler<C extends net.minecraft.world.item.crafting.RecipeInput,T extends net.minecraft.world.item.crafting.Recipe<C>>
extends Object
implements IRecipeHandler
Recipe handler capability for recipe types.
-
Field Summary
Modifier and TypeFieldDescriptionstatic final net.minecraft.world.inventory.AbstractContainerMenu
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic List
<IPrototypedIngredient<net.minecraft.world.item.ItemStack, Integer>> getPrototypesFromIngredient
(net.minecraft.world.item.crafting.Ingredient ingredient) A heuristical method for converting an ingredient to a list of prototyped ingredients.Set
<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.static <C extends net.minecraft.world.item.crafting.RecipeInput,
T extends net.minecraft.world.item.crafting.Recipe<C>>
IRecipeDefinitionrecipeToRecipeDefinition
(T recipe, net.minecraft.world.level.Level level) simulate
(IMixedIngredients input) Test if the given recipe input can be handled by this handler.
-
Field Details
-
DUMMY_CONTAINTER
public static final net.minecraft.world.inventory.AbstractContainerMenu DUMMY_CONTAINTER
-
-
Constructor Details
-
VanillaRecipeTypeRecipeHandler
-
-
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.
-
isValidSizeInput
Description copied from interface:IRecipeHandler
Check if the given size of recipe component instances are valid for the given recipe component type.- Specified by:
isValidSizeInput
in interfaceIRecipeHandler
- 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.
-
getPrototypesFromIngredient
public static List<IPrototypedIngredient<net.minecraft.world.item.ItemStack,Integer>> getPrototypesFromIngredient(net.minecraft.world.item.crafting.Ingredient ingredient) A heuristical method for converting an ingredient to a list of prototyped ingredients.- Parameters:
ingredient
- An ingredient.- Returns:
- A list of prototyped ingredients.
-
recipeToRecipeDefinition
@Nullable public static <C extends net.minecraft.world.item.crafting.RecipeInput,T extends net.minecraft.world.item.crafting.Recipe<C>> IRecipeDefinition recipeToRecipeDefinition(T recipe, net.minecraft.world.level.Level level) -
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.
-
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.
-