From 67b766c674d57d64f4117cc8fa80beb34ee43b94 Mon Sep 17 00:00:00 2001 From: James Seibel Date: Thu, 10 Jul 2025 07:26:14 -0500 Subject: [PATCH] Fix monoliths when connected to a server --- .../distanthorizons/core/level/DhClientLevel.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/core/src/main/java/com/seibel/distanthorizons/core/level/DhClientLevel.java b/core/src/main/java/com/seibel/distanthorizons/core/level/DhClientLevel.java index ec872b650..5bf8501b9 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/level/DhClientLevel.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/level/DhClientLevel.java @@ -164,7 +164,7 @@ public class DhClientLevel extends AbstractDhLevel implements IDhClientLevel } - try (FullDataSourceV2DTO dataSourceDto = this.networkState.fullDataPayloadReceiver.decodeDataSourceAndReleaseBuffer(message.payload)) + try(FullDataSourceV2DTO dataSourceDto = this.networkState.fullDataPayloadReceiver.decodeDataSourceAndReleaseBuffer(message.payload)) { boolean isSameLevel = message.isSameLevelAs(this.levelWrapper); NETWORK_LOGGER.debug("Buffer {} isSameLevel: {}", message.payload.dtoBufferId, isSameLevel); @@ -183,9 +183,6 @@ public class DhClientLevel extends AbstractDhLevel implements IDhClientLevel { // TODO this has a lock which can cause stuttering/lag issues this.updateBeaconBeamsForSectionPos(dataSourceDto.pos, message.payload.beaconBeams); - - FullDataSourceV2 fullDataSource = dataSourceDto.createDataSource(this.levelWrapper); - this.updateDataSourcesAsync(fullDataSource).whenComplete((result, e) -> fullDataSource.close()); } catch (Exception e) { @@ -193,6 +190,11 @@ public class DhClientLevel extends AbstractDhLevel implements IDhClientLevel } }); } + + + FullDataSourceV2 fullDataSource = dataSourceDto.createDataSource(this.levelWrapper); + this.updateDataSourcesAsync(fullDataSource) + .whenComplete((result, e) -> fullDataSource.close()); } catch (Exception e) {