Merge pull request #261 from Fabbboy/fixcrash
fix #247 ConcurrentModificationException
This commit is contained in:
@@ -409,18 +409,20 @@ public class VatBlockEntity extends SmartBlockEntity implements IHaveGoggleInfor
|
|||||||
handleRecipe();
|
handleRecipe();
|
||||||
|
|
||||||
if (isController()) {
|
if (isController()) {
|
||||||
for (BlockPos machinePos : machineMap.keySet()) {
|
Iterator<BlockPos> iter = machineMap.keySet().iterator();
|
||||||
|
while (iter.hasNext()) {
|
||||||
|
BlockPos machinePos = iter.next();
|
||||||
BlockEntity blockEntity = level.getBlockEntity(machinePos);
|
BlockEntity blockEntity = level.getBlockEntity(machinePos);
|
||||||
if (blockEntity != null) {
|
if (blockEntity != null) {
|
||||||
if (blockEntity instanceof IVatMachine vatMachine) {
|
if (blockEntity instanceof IVatMachine vatMachine) {
|
||||||
boolean operational = vatMachine.canOperate(this);
|
boolean operational = vatMachine.canOperate(this);
|
||||||
operationalMachinesMap.put(machinePos, operational);
|
operationalMachinesMap.put(machinePos, operational);
|
||||||
} else {
|
} else {
|
||||||
machineMap.remove(machinePos);
|
iter.remove();
|
||||||
operationalMachinesMap.remove(machinePos);
|
operationalMachinesMap.remove(machinePos);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
machineMap.remove(machinePos);
|
iter.remove();
|
||||||
operationalMachinesMap.remove(machinePos);
|
operationalMachinesMap.remove(machinePos);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user