From 20cea7e6b993cc934fb915ca305a2c167e54740d Mon Sep 17 00:00:00 2001 From: Fabrice Date: Thu, 9 Oct 2025 12:20:43 +0200 Subject: [PATCH] fix #247 ConcurrentModificationException --- .../tfmg/content/machinery/vat/base/VatBlockEntity.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/drmangotea/tfmg/content/machinery/vat/base/VatBlockEntity.java b/src/main/java/com/drmangotea/tfmg/content/machinery/vat/base/VatBlockEntity.java index a79e4e37..13192ac1 100644 --- a/src/main/java/com/drmangotea/tfmg/content/machinery/vat/base/VatBlockEntity.java +++ b/src/main/java/com/drmangotea/tfmg/content/machinery/vat/base/VatBlockEntity.java @@ -409,18 +409,20 @@ public class VatBlockEntity extends SmartBlockEntity implements IHaveGoggleInfor handleRecipe(); if (isController()) { - for (BlockPos machinePos : machineMap.keySet()) { + Iterator iter = machineMap.keySet().iterator(); + while (iter.hasNext()) { + BlockPos machinePos = iter.next(); BlockEntity blockEntity = level.getBlockEntity(machinePos); if (blockEntity != null) { if (blockEntity instanceof IVatMachine vatMachine) { boolean operational = vatMachine.canOperate(this); operationalMachinesMap.put(machinePos, operational); } else { - machineMap.remove(machinePos); + iter.remove(); operationalMachinesMap.remove(machinePos); } } else { - machineMap.remove(machinePos); + iter.remove(); operationalMachinesMap.remove(machinePos); } }