From ecaed8578e55a4f051e8b50dfba8df63913414bf Mon Sep 17 00:00:00 2001 From: Sutton Hathorn Date: Wed, 22 May 2019 17:16:19 -0400 Subject: [PATCH] Use setChunkForceLoaded to keep needed chunks loaded --- src/main/java/com/wimbli/WorldBorder/WorldFillTask.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/main/java/com/wimbli/WorldBorder/WorldFillTask.java b/src/main/java/com/wimbli/WorldBorder/WorldFillTask.java index 5e73ebf..248f9a7 100644 --- a/src/main/java/com/wimbli/WorldBorder/WorldFillTask.java +++ b/src/main/java/com/wimbli/WorldBorder/WorldFillTask.java @@ -234,7 +234,10 @@ public class WorldFillTask implements Runnable if (worldData.doesChunkExist(dependency.forX, dependency.forZ)) chunksToUnload.add(new CoordXZ(dependency.neededX, dependency.neededZ)); else + { + world.setChunkForceLoaded(dependency.neededX, dependency.neededZ, true); newPreventUnload.add(dependency); + } } preventUnload = newPreventUnload; @@ -247,6 +250,7 @@ public class WorldFillTask implements Runnable for (CoordXZ unload: chunksToUnload) { if (!chunkOnUnloadPreventionList(unload.x, unload.z)) + world.setChunkForceLoaded(unload.x, unload.z, false); world.unloadChunkRequest(unload.x, unload.z); } @@ -443,6 +447,7 @@ public class WorldFillTask implements Runnable preventUnload = null; for (UnloadDependency entry: tempPreventUnload) { + world.setChunkForceLoaded(entry.neededX, entry.neededZ, false); world.unloadChunkRequest(entry.neededX, entry.neededZ); } }