diff --git a/core/src/main/java/com/seibel/distanthorizons/core/api/internal/ClientApi.java b/core/src/main/java/com/seibel/distanthorizons/core/api/internal/ClientApi.java index d5bc40a9a..acb18b5f9 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/api/internal/ClientApi.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/api/internal/ClientApi.java @@ -134,27 +134,24 @@ public class ClientApi public void onClientOnlyDisconnected() { - if (MC.clientConnectedToDedicatedServer()) + AbstractDhWorld world = SharedApi.getAbstractDhWorld(); + if (world != null) { - AbstractDhWorld world = SharedApi.getAbstractDhWorld(); - if (world != null) - { - LOGGER.info("Client on ClientOnly mode disconnecting."); - - world.close(); - SharedApi.setDhWorld(null); - } + LOGGER.info("Client on ClientOnly mode disconnecting."); - // clear the previous server's information - this.isServerCommunicationEnabled = false; - this.serverNetworkingIsMalformed = false; - KEYED_CLIENT_LEVEL_MANAGER.setUseOverrideWrapper(false); - KEYED_CLIENT_LEVEL_MANAGER.setServerKeyedLevel(null); - - // remove any waiting items - this.waitingChunkByClientLevelAndPos.clear(); - this.waitingClientLevels.clear(); + world.close(); + SharedApi.setDhWorld(null); } + + // clear the previous server's information + this.isServerCommunicationEnabled = false; + this.serverNetworkingIsMalformed = false; + KEYED_CLIENT_LEVEL_MANAGER.setUseOverrideWrapper(false); + KEYED_CLIENT_LEVEL_MANAGER.setServerKeyedLevel(null); + + // remove any waiting items + this.waitingChunkByClientLevelAndPos.clear(); + this.waitingClientLevels.clear(); }