From 8d1bd8f94354b52622fdc1cee70c955a08aabd11 Mon Sep 17 00:00:00 2001 From: Ellpeck Date: Tue, 3 Dec 2024 23:29:41 +0100 Subject: [PATCH] fixed a cme when canceled crafts are removed closes #228 --- .../prettypipes/pipe/modules/craft/CraftingModuleItem.java | 4 +--- 1 file changed, 1 insertion(+), 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 b08ad5f..ce2ee42 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 @@ -210,9 +210,7 @@ public class CraftingModuleItem extends ModuleItem { var contents = module.get(Contents.TYPE); var equalityTypes = ItemFilter.getEqualityTypes(tile); var allCrafts = tile.getActiveCrafts(); - var ourCrafts = allCrafts.stream().filter(c -> c.moduleSlot == slot && !c.getTravelingIngredient(stack, equalityTypes).isEmpty()).iterator(); - while (ourCrafts.hasNext()) { - var craft = ourCrafts.next(); + for (var craft : allCrafts.stream().filter(c -> c.moduleSlot == slot && !c.getTravelingIngredient(stack, equalityTypes).isEmpty()).toList()) { craft.travelingIngredients.remove(craft.getTravelingIngredient(stack, equalityTypes)); if (contents.insertSingles) {