Class RecyclingManager
java.lang.Object
com.petrolpark.core.recipe.recycling.RecyclingManager
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final Map<net.minecraft.world.item.crafting.Ingredient, RecyclingOutputs> protected static final Map<net.minecraft.world.item.Item, RecyclingOutputs> protected static final Set<RecyclingOutputsModifier> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic final RecyclingOutputsgetInverse(net.minecraft.world.item.crafting.Ingredient ingredient) static final RecyclingOutputsgetInverseRecipeRecyclingOutputs(net.minecraft.world.level.Level level, net.minecraft.world.item.Item item) Get theRecyclingOutputsof the Item, based any Recipes used to craft it.static final RecyclingOutputsgetRawRecyclingOutputs(net.minecraft.world.level.Level level, net.minecraft.world.item.ItemStack stack) Get theRecyclingOutputs from recycling this Stack, before adjusting for the size of the Stack and before applying anyRecyclingOutputsModifiers.static final RecyclingOutputsgetRecyclingOutputs(net.minecraft.world.level.Level level, net.minecraft.world.item.ItemStack stack) Recycle an Item Stack.static final voidonAddReloadListeners(net.neoforged.neoforge.event.AddReloadListenerEvent event) static final voidonRecipesUpdated(net.neoforged.neoforge.client.event.RecipesUpdatedEvent event) static final voidregisterModifier(RecyclingOutputsModifier recyclingOutputsModifier) static final voidreload(net.minecraft.world.item.crafting.RecipeManager recipeManager)
-
Field Details
-
INGREDIENT_INVERSES
protected static final Map<net.minecraft.world.item.crafting.Ingredient,RecyclingOutputs> INGREDIENT_INVERSES -
ITEM_RECYCLINGS
-
OUTPUT_MODIFIERS
-
-
Constructor Details
-
RecyclingManager
public RecyclingManager()
-
-
Method Details
-
registerModifier
- 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 theRecyclingOutputsof the Item, based any Recipes used to craft it. This callsRecipe.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 implementIRecyclableRecipe.- Parameters:
level-item-- Returns:
- A
RecyclingOutputs, orRecyclingOutputs.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 theRecyclingOutputs from recycling this Stack, before adjusting for the size of the Stack and before applying anyRecyclingOutputsModifiers.- Parameters:
level-stack-Countis 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) Recycle an Item Stack. An explanation of how this is done can be found here.- 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)
-