From b25ad992e63442a9c750978a7cb65e49c1f8cfce Mon Sep 17 00:00:00 2001 From: Ellpeck Date: Mon, 16 Nov 2020 23:15:35 +0100 Subject: [PATCH] fixed some crafting module miscalculations --- .../prettypipes/pipe/modules/craft/CraftingModuleItem.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/main/java/de/ellpeck/prettypipes/pipe/modules/craft/CraftingModuleItem.java b/src/main/java/de/ellpeck/prettypipes/pipe/modules/craft/CraftingModuleItem.java index 81ca8b1..cb3387f 100644 --- a/src/main/java/de/ellpeck/prettypipes/pipe/modules/craft/CraftingModuleItem.java +++ b/src/main/java/de/ellpeck/prettypipes/pipe/modules/craft/CraftingModuleItem.java @@ -182,12 +182,13 @@ public class CraftingModuleItem extends ModuleItem { tile.craftIngredientRequests.addAll(ret.getLeft()); } + ItemStack remain = stack.copy(); + remain.shrink(resultAmount * toCraft); + ItemStack result = stack.copy(); - result.setCount(resultAmount * toCraft); + result.shrink(remain.getCount()); tile.craftResultRequests.add(Pair.of(destPipe, result)); - ItemStack remain = stack.copy(); - remain.shrink(toCraft); return remain; }