Interface IRecyclableRecipe
- All Known Implementing Classes:
WoodCraftingShapedRecipe
public interface IRecyclableRecipe
A
Recipe which can be reversed by recycling.
It is recommended you implement this on Recipes where finding the Ingredients used to craft an Item is more complicated than
the naive inversal of Recipe.getIngredients() done in RecyclingManager.getInverse(net.minecraft.world.item.crafting.Ingredient).-
Method Summary
Modifier and TypeMethodDescriptionstatic IRecyclableRecipecast(net.minecraft.world.item.crafting.Recipe<?> recipe) getRecyclingOutputs(net.minecraft.world.level.Level level, net.minecraft.world.item.ItemStack stack) Get (optionally) the Items that would have been used to craft the given Item Stack with this Recipe, wrapped asRecyclingOutputs.static booleanisInstance(net.minecraft.world.item.crafting.Recipe<?> recipe)
-
Method Details
-
getRecyclingOutputs
Optional<RecyclingOutputs> getRecyclingOutputs(net.minecraft.world.level.Level level, net.minecraft.world.item.ItemStack stack) Get (optionally) the Items that would have been used to craft the given Item Stack with this Recipe, wrapped asRecyclingOutputs. This method should not consider the size of this Item Stack (which should always be 1) or replicate the effects of anyRecyclingOutputsModifiers as these will be applied separately.- Parameters:
level-stack-- Returns:
- Optional containing the
RecyclingOutputs(possiblyemptyitself) for recycling the given Item Stack as the inverse of this Recipe, or an empty Optional if that Item Stack could never be produced by this Recipe and the recycling should pass to the default handling
-
cast
-
isInstance
static boolean isInstance(net.minecraft.world.item.crafting.Recipe<?> recipe)
-