Skip to content

Commit 8d1bd8f

Browse files
committed
fixed a cme when canceled crafts are removed
closes #228
1 parent af33933 commit 8d1bd8f

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/main/java/de/ellpeck/prettypipes/pipe/modules/craft/CraftingModuleItem.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -210,9 +210,7 @@ public ItemStack store(ItemStack module, PipeBlockEntity tile, ItemStack stack,
210210
var contents = module.get(Contents.TYPE);
211211
var equalityTypes = ItemFilter.getEqualityTypes(tile);
212212
var allCrafts = tile.getActiveCrafts();
213-
var ourCrafts = allCrafts.stream().filter(c -> c.moduleSlot == slot && !c.getTravelingIngredient(stack, equalityTypes).isEmpty()).iterator();
214-
while (ourCrafts.hasNext()) {
215-
var craft = ourCrafts.next();
213+
for (var craft : allCrafts.stream().filter(c -> c.moduleSlot == slot && !c.getTravelingIngredient(stack, equalityTypes).isEmpty()).toList()) {
216214
craft.travelingIngredients.remove(craft.getTravelingIngredient(stack, equalityTypes));
217215

218216
if (contents.insertSingles) {

0 commit comments

Comments
 (0)