From f4c036a323205230aa702b61d280983779382bc9 Mon Sep 17 00:00:00 2001 From: DrParadox7 Date: Mon, 25 Sep 2023 22:41:49 +0200 Subject: [PATCH] More CME Fixes --- .../api/transmitters/TransmitterNetworkRegistry.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/main/java/mekanism/api/transmitters/TransmitterNetworkRegistry.java b/src/main/java/mekanism/api/transmitters/TransmitterNetworkRegistry.java index 79445e30b82..170328b8844 100644 --- a/src/main/java/mekanism/api/transmitters/TransmitterNetworkRegistry.java +++ b/src/main/java/mekanism/api/transmitters/TransmitterNetworkRegistry.java @@ -109,8 +109,9 @@ public void removeInvalidTransmitters() { logger.info("Dealing with " + invalidTransmitters.size() + " invalid Transmitters"); } - - for(IGridTransmitter invalid : invalidTransmitters) + + HashSet orphanTransmitterCopy = new HashSet<>(invalidTransmitters); + for(IGridTransmitter invalid : orphanTransmitterCopy) { if(!(invalid.isOrphan() && invalid.isValid())) { @@ -132,8 +133,9 @@ public void assignOrphans() { logger.info("Dealing with " + orphanTransmitters.size() + " orphan Transmitters"); } - - for(IGridTransmitter orphanTransmitter : orphanTransmitters.values()) + + HashMap orphanTransmitterCopy = new HashMap(orphanTransmitters); + for(IGridTransmitter orphanTransmitter : orphanTransmitterCopy.values()) { DynamicNetwork network = getNetworkFromOrphan(orphanTransmitter);