diff --git a/core/src/main/java/com/seibel/distanthorizons/core/api/internal/ServerApi.java b/core/src/main/java/com/seibel/distanthorizons/core/api/internal/ServerApi.java index 0d9e1b2e0..4f1d3faf3 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/api/internal/ServerApi.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/api/internal/ServerApi.java @@ -159,7 +159,7 @@ public class ServerApi } } } - public void serverChunkSaveEvent(IChunkWrapper chunk, ILevelWrapper level) + public void serverChunkSaveEvent(IChunkWrapper chunkWrapper, ILevelWrapper level) { AbstractDhWorld dhWorld = SharedApi.getAbstractDhWorld(); if (dhWorld == null) @@ -179,13 +179,13 @@ public class ServerApi { // Save or populate the chunk wrapper's lighting // this is done so we don't have to worry about MC unloading the lighting data for this chunk - if (chunk.isLightCorrect()) + if (chunkWrapper.isLightCorrect()) { try { // If MC's lighting engine isn't thread safe this may cause the server thread to lag - chunk.bakeDhLightingUsingMcLightingEngine(); - chunk.setUseDhLighting(true); + chunkWrapper.bakeDhLightingUsingMcLightingEngine(); + chunkWrapper.setUseDhLighting(true); } catch (IllegalStateException e) { @@ -197,12 +197,12 @@ public class ServerApi // generate the chunk's lighting, ignoring neighbors. // not a perfect solution, but should prevent chunks from having completely broken lighting List nearbyChunkList = new LinkedList<>(); - nearbyChunkList.add(chunk); - DhLightingEngine.INSTANCE.lightChunks(chunk, nearbyChunkList, level.hasSkyLight() ? 15 : 0); - chunk.setUseDhLighting(true); + nearbyChunkList.add(chunkWrapper); + DhLightingEngine.INSTANCE.lightChunks(chunkWrapper, nearbyChunkList, level.hasSkyLight() ? 15 : 0); + chunkWrapper.setUseDhLighting(true); } - dhLevel.updateChunkAsync(chunk); + dhLevel.updateChunkAsync(chunkWrapper); }); } diff --git a/core/src/main/java/com/seibel/distanthorizons/core/wrapperInterfaces/chunk/IChunkWrapper.java b/core/src/main/java/com/seibel/distanthorizons/core/wrapperInterfaces/chunk/IChunkWrapper.java index 1e3ed44d7..06136d7b9 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/wrapperInterfaces/chunk/IChunkWrapper.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/wrapperInterfaces/chunk/IChunkWrapper.java @@ -91,6 +91,8 @@ public interface IChunkWrapper extends IBindable } } } + + this.setIsDhLightCorrect(true); }