Ensure regen step not running on the main thread (#2185)

Dieser Commit ist enthalten in:
Hannes Greule 2023-04-23 22:15:37 +02:00 committet von GitHub
Ursprung 488a2e5de4
Commit c86dfe45df
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: 4AEE18F83AFDEB23

Datei anzeigen

@ -253,10 +253,13 @@ public abstract class Regenerator<IChunkAccess, ProtoChunk extends IChunkAccess,
e.printStackTrace(); e.printStackTrace();
} }
} else { // Concurrency.NONE or generateConcurrent == false } else { // Concurrency.NONE or generateConcurrent == false
// run sequential // run sequential but submit to different thread
for (long xz : coords) { // running regen on the main thread otherwise triggers async-only events on the main thread
chunkStatus.processChunkSave(xz, worldlimits.get(radius).get(xz)); executor.submit(() -> {
} for (long xz : coords) {
chunkStatus.processChunkSave(xz, worldlimits.get(radius).get(xz));
}
}).get(); // wait until finished this step
} }
} }