fixed a cme when canceled crafts are removed

closes #228
This commit is contained in:
Ell 2024-12-03 23:29:41 +01:00
parent af3393345b
commit 8d1bd8f943

View file

@ -210,9 +210,7 @@ public class CraftingModuleItem extends ModuleItem {
var contents = module.get(Contents.TYPE); var contents = module.get(Contents.TYPE);
var equalityTypes = ItemFilter.getEqualityTypes(tile); var equalityTypes = ItemFilter.getEqualityTypes(tile);
var allCrafts = tile.getActiveCrafts(); var allCrafts = tile.getActiveCrafts();
var ourCrafts = allCrafts.stream().filter(c -> c.moduleSlot == slot && !c.getTravelingIngredient(stack, equalityTypes).isEmpty()).iterator(); for (var craft : allCrafts.stream().filter(c -> c.moduleSlot == slot && !c.getTravelingIngredient(stack, equalityTypes).isEmpty()).toList()) {
while (ourCrafts.hasNext()) {
var craft = ourCrafts.next();
craft.travelingIngredients.remove(craft.getTravelingIngredient(stack, equalityTypes)); craft.travelingIngredients.remove(craft.getTravelingIngredient(stack, equalityTypes));
if (contents.insertSingles) { if (contents.insertSingles) {