Class RecyclingManager

java.lang.Object
com.petrolpark.core.recipe.recycling.RecyclingManager

public class RecyclingManager extends Object
  • Field Details

    • INGREDIENT_INVERSES

      protected static final Map<net.minecraft.world.item.crafting.Ingredient,RecyclingOutputs> INGREDIENT_INVERSES
    • ITEM_RECYCLINGS

      protected static final Map<net.minecraft.world.item.Item,RecyclingOutputs> ITEM_RECYCLINGS
    • OUTPUT_MODIFIERS

      protected static final Set<RecyclingOutputsModifier> OUTPUT_MODIFIERS
  • Constructor Details

    • RecyclingManager

      public RecyclingManager()
  • Method Details

    • registerModifier

      public static final void registerModifier(RecyclingOutputsModifier recyclingOutputsModifier)
      Parameters:
      recyclingOutputsModifier -
      See Also:
    • reload

      public static final void reload(net.minecraft.world.item.crafting.RecipeManager recipeManager)
    • getInverse

      public static final RecyclingOutputs getInverse(net.minecraft.world.item.crafting.Ingredient ingredient)
    • getInverseRecipeRecyclingOutputs

      public static final RecyclingOutputs getInverseRecipeRecyclingOutputs(net.minecraft.world.level.Level level, net.minecraft.world.item.Item item)
      Get the RecyclingOutputs of the Item, based any Recipes used to craft it. This calls Recipe.getIngredients() and tries to determine the inverse of each of those Ingredients, so if Recipes have other inputs (e.g. Fluid Ingredients) they will not be covered by this and should implement IRecyclableRecipe.
      Parameters:
      level -
      item -
      Returns:
      A RecyclingOutputs, or RecyclingOutputs.empty() if there are multiple different Recipes for crafting this Item
    • getRawRecyclingOutputs

      public static final RecyclingOutputs getRawRecyclingOutputs(net.minecraft.world.level.Level level, net.minecraft.world.item.ItemStack stack)
      Get the RecyclingOutputs from recycling this Stack, before adjusting for the size of the Stack and before applying any RecyclingOutputsModifiers.
      Parameters:
      level -
      stack - Count is ignored
      Returns:
      Copy of a RecyclingOutputs, safe to modify
      See Also:
    • getRecyclingOutputs

      public static final RecyclingOutputs getRecyclingOutputs(net.minecraft.world.level.Level level, net.minecraft.world.item.ItemStack stack)
      Parameters:
      level -
      stack -
      Returns:
      (Possibly empty) RecyclingOutputs
    • onRecipesUpdated

      public static final void onRecipesUpdated(net.neoforged.neoforge.client.event.RecipesUpdatedEvent event)
    • onAddReloadListeners

      public static final void onAddReloadListeners(net.neoforged.neoforge.event.AddReloadListenerEvent event)