From fd2ee3f71f96c6030673e61a922ead183a56a82a Mon Sep 17 00:00:00 2001 From: mcrcortex <18544518+MCRcortex@users.noreply.github.com> Date: Sun, 9 Mar 2025 12:19:45 +1000 Subject: [PATCH] More things --- src/main/java/me/cortex/voxy/common/world/WorldEngine.java | 4 ++-- .../me/cortex/voxy/commonImpl/importers/WorldImporter.java | 6 +++++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/main/java/me/cortex/voxy/common/world/WorldEngine.java b/src/main/java/me/cortex/voxy/common/world/WorldEngine.java index 31303950..adc032a3 100644 --- a/src/main/java/me/cortex/voxy/common/world/WorldEngine.java +++ b/src/main/java/me/cortex/voxy/common/world/WorldEngine.java @@ -41,8 +41,8 @@ public class WorldEngine { this.maxMipLevels = maxMipLayers; this.storage = storage; this.mapper = new Mapper(this.storage); - //4 cache size bits means that the section tracker has 16 separate maps that it uses - this.sectionTracker = new ActiveSectionTracker(4, storage::loadSection, cacheCount, this); + //5 cache size bits means that the section tracker has 32 separate maps that it uses + this.sectionTracker = new ActiveSectionTracker(5, storage::loadSection, cacheCount, this); } public WorldSection acquireIfExists(int lvl, int x, int y, int z) { diff --git a/src/main/java/me/cortex/voxy/commonImpl/importers/WorldImporter.java b/src/main/java/me/cortex/voxy/commonImpl/importers/WorldImporter.java index 7ae10bb6..bfe33702 100644 --- a/src/main/java/me/cortex/voxy/commonImpl/importers/WorldImporter.java +++ b/src/main/java/me/cortex/voxy/commonImpl/importers/WorldImporter.java @@ -131,7 +131,9 @@ public class WorldImporter { throw new RuntimeException(e); } } - this.threadPool.shutdown(); + if (!this.threadPool.isFreed()) { + this.threadPool.shutdown(); + } } private interface IImporterMethod { @@ -237,6 +239,8 @@ public class WorldImporter { } } onCompletion.accept(this.totalChunks.get()); + + this.threadPool.shutdown(); this.worker = null; }); this.worker.setName("World importer");