More things

This commit is contained in:
mcrcortex
2025-03-09 12:19:45 +10:00
parent 60b878d53c
commit fd2ee3f71f
2 changed files with 7 additions and 3 deletions

View File

@@ -41,8 +41,8 @@ public class WorldEngine {
this.maxMipLevels = maxMipLayers; this.maxMipLevels = maxMipLayers;
this.storage = storage; this.storage = storage;
this.mapper = new Mapper(this.storage); this.mapper = new Mapper(this.storage);
//4 cache size bits means that the section tracker has 16 separate maps that it uses //5 cache size bits means that the section tracker has 32 separate maps that it uses
this.sectionTracker = new ActiveSectionTracker(4, storage::loadSection, cacheCount, this); this.sectionTracker = new ActiveSectionTracker(5, storage::loadSection, cacheCount, this);
} }
public WorldSection acquireIfExists(int lvl, int x, int y, int z) { public WorldSection acquireIfExists(int lvl, int x, int y, int z) {

View File

@@ -131,7 +131,9 @@ public class WorldImporter {
throw new RuntimeException(e); throw new RuntimeException(e);
} }
} }
this.threadPool.shutdown(); if (!this.threadPool.isFreed()) {
this.threadPool.shutdown();
}
} }
private interface IImporterMethod <T> { private interface IImporterMethod <T> {
@@ -237,6 +239,8 @@ public class WorldImporter {
} }
} }
onCompletion.accept(this.totalChunks.get()); onCompletion.accept(this.totalChunks.get());
this.threadPool.shutdown();
this.worker = null; this.worker = null;
}); });
this.worker.setName("World importer"); this.worker.setName("World importer");