Resolve medieval engine late

- MedievalPregenMethod re-resolves its engine on each call until one exists, then caches it
- Hydrology prefetch opens its epoch at the first prepare that sees the engine, with the stored region bounds
- MedievalPregenMethodTest covers a null first prepare followed by concurrent prepares opening the epoch once
This commit is contained in:
Brian Neumann-Fopiano committed 2026-11-02 00:18:58 -05:00
1 parent 6cbe4b2c09
commit 95fa3ce105
2 files changed
+92 -5

No files matched your search

@@ -62,7 +62,6 @@ public class MedievalPregenMethod implements PregeneratorMethod {
private final Executor chunkIoExecutor;
private final PregenSerialWorker chunkFlush;
private volatile Engine cachedEngine;
private volatile boolean engineResolutionAttempted;
private final AtomicBoolean closing = new AtomicBoolean();
private final PregenHydrology hydrology = new PregenHydrology(this::resolveEngine);
@@ -99,10 +98,6 @@ public class MedievalPregenMethod implements PregeneratorMethod {
if (cached != null) {
return cached;
}
if (engineResolutionAttempted) {
return null;
}
engineResolutionAttempted = true;
try {
if (!IrisToolbelt.isIrisWorld(world)) {
return null;