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 Type
    Method
    Description
    cast(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 as RecyclingOutputs.
    static boolean
    isInstance(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 as RecyclingOutputs. This method should not consider the size of this Item Stack (which should always be 1) or replicate the effects of any RecyclingOutputsModifiers as these will be applied separately.
      Parameters:
      level -
      stack -
      Returns:
      Optional containing the RecyclingOutputs (possibly empty itself) 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

      @Nullable static IRecyclableRecipe cast(net.minecraft.world.item.crafting.Recipe<?> recipe)
    • isInstance

      static boolean isInstance(net.minecraft.world.item.crafting.Recipe<?> recipe)