diff --git a/common/src/main/java/com/seibel/distanthorizons/common/wrappers/world/ClientLevelWrapper.java b/common/src/main/java/com/seibel/distanthorizons/common/wrappers/world/ClientLevelWrapper.java index fe7b5cb3f..4a8602412 100644 --- a/common/src/main/java/com/seibel/distanthorizons/common/wrappers/world/ClientLevelWrapper.java +++ b/common/src/main/java/com/seibel/distanthorizons/common/wrappers/world/ClientLevelWrapper.java @@ -112,11 +112,7 @@ public class ClientLevelWrapper implements IClientLevelWrapper private void unload() { AbstractDhWorld world = SharedApi.getAbstractDhWorld(); - if (world != null) - { - world.unloadLevel(this); - } - else + if (world == null || !world.unloadLevel(this)) { this.onUnload(); } @@ -132,6 +128,8 @@ public class ClientLevelWrapper implements IClientLevelWrapper long currentTime = System.currentTimeMillis(); long timeout = 30 * 1000; + System.out.println("Current: " + LEVEL_WRAPPER_REF_BY_CLIENT_LEVEL); + ArrayList toUnload = new ArrayList<>(); synchronized(LEVEL_WRAPPER_REF_BY_CLIENT_LEVEL) { @@ -141,6 +139,7 @@ public class ClientLevelWrapper implements IClientLevelWrapper if (wrapper != null && wrapper.level != MINECRAFT.level) { + System.out.println("Thinking of unloading: " + wrapper + " Time: " + (currentTime - wrapper.getLastAccessTime())); // We use the synchronized getter to prevent race conditions with markAccessed() if (currentTime - wrapper.getLastAccessTime() > timeout) { diff --git a/coreSubProjects b/coreSubProjects index 5cb30ed7c..cc2febcb5 160000 --- a/coreSubProjects +++ b/coreSubProjects @@ -1 +1 @@ -Subproject commit 5cb30ed7ceb649ab4d9b765de79b3e04930955e4 +Subproject commit cc2febcb5cc983867ac7e0d68d21a46cf6fe9f11