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);