set chunk status to full AFTER generation

This commit is contained in:
Julian Krings
2025-02-08 20:59:20 +01:00
parent 22622f6e8a
commit 6e84d38680
16 changed files with 76 additions and 48 deletions

View File

@@ -7,4 +7,6 @@ public interface SerializableChunk extends TerrainChunk {
Position2 getPos();
Object serialize();
void mark();
}

View File

@@ -169,6 +169,7 @@ public class IrisHeadless {
biomes.apply();
storage.fillBiomes(chunk, ctx);
chunk.mark();
long key = Cache.key(x >> 5, z >> 5);
regions.computeIfAbsent(key, Region::new)
@@ -255,7 +256,7 @@ public class IrisHeadless {
@Override
public void run() {
try (IRegion region = storage.getRegion(x, z, false)){
try (IRegion region = storage.getRegion(x, z, false)) {
assert region != null;
for (var chunk : chunks) {
@@ -269,7 +270,8 @@ public class IrisHeadless {
}
} catch (Throwable e) {
Iris.error("Failed to load region file " + x + ", " + z);
Iris.reportError(e);
e.printStackTrace();
loadedChunks.addAndGet(-chunks.size());
}
regions.remove(key);