From 193547aba2ff0f68ca4cc07bf6b1a74b9618e350 Mon Sep 17 00:00:00 2001 From: Darkere Date: Sun, 13 Jun 2021 11:40:21 +0200 Subject: [PATCH] fix for processing recipes --- .../refinedstorage/integration/jei/IngredientTracker.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/refinedmods/refinedstorage/integration/jei/IngredientTracker.java b/src/main/java/com/refinedmods/refinedstorage/integration/jei/IngredientTracker.java index 11082a4838..c2579850f3 100644 --- a/src/main/java/com/refinedmods/refinedstorage/integration/jei/IngredientTracker.java +++ b/src/main/java/com/refinedmods/refinedstorage/integration/jei/IngredientTracker.java @@ -6,7 +6,9 @@ import com.refinedmods.refinedstorage.screen.grid.stack.IGridStack; import mezz.jei.api.gui.IRecipeLayout; import mezz.jei.api.gui.ingredient.IGuiIngredient; +import net.minecraft.client.Minecraft; import net.minecraft.item.ItemStack; +import net.minecraft.util.NonNullList; import net.minecraft.util.ResourceLocation; import javax.annotation.Nullable; @@ -31,8 +33,10 @@ public Collection getIngredients() { public void addAvailableStack(ItemStack stack, @Nullable IGridStack gridStack) { int available = stack.getCount(); if (stack.getItem() instanceof PatternItem) { - ItemStack outputStack = PatternItem.getOutputSlot(stack, 0); - storedItems.merge(outputStack.getItem().getRegistryName(), available, Integer::sum); + NonNullList outputStacks = PatternItem.fromCache(Minecraft.getInstance().world,stack).getOutputs(); + for (ItemStack outputStack : outputStacks) { + storedItems.merge(outputStack.getItem().getRegistryName(), outputStack.getCount(), Integer::sum); + } } else { storedItems.merge(stack.getItem().getRegistryName(), available, Integer::sum); }