Skip to content

Commit

Permalink
fix for processing recipes
Browse files Browse the repository at this point in the history
  • Loading branch information
Darkere committed Jun 13, 2021
1 parent 7d6bc10 commit 193547a
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -31,8 +33,10 @@ public Collection<Ingredient> 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<ItemStack> 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);
}
Expand Down

0 comments on commit 193547a

Please sign in to comment.