From 731842e09c8142d7454325ef4b58184f81c62370 Mon Sep 17 00:00:00 2001 From: James Seibel Date: Thu, 29 Aug 2024 19:54:44 -0500 Subject: [PATCH] Fix DH beacon detection logic breaking the lighting engine --- .../common/wrappers/chunk/ChunkWrapper.java | 10 ++++++++-- coreSubProjects | 2 +- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/common/src/main/java/com/seibel/distanthorizons/common/wrappers/chunk/ChunkWrapper.java b/common/src/main/java/com/seibel/distanthorizons/common/wrappers/chunk/ChunkWrapper.java index 26a4124c9..28b8a4db3 100644 --- a/common/src/main/java/com/seibel/distanthorizons/common/wrappers/chunk/ChunkWrapper.java +++ b/common/src/main/java/com/seibel/distanthorizons/common/wrappers/chunk/ChunkWrapper.java @@ -463,7 +463,7 @@ public class ChunkWrapper implements IChunkWrapper * before the list has finished populating. */ @Override - public synchronized ArrayList getBlockLightPosList() + public synchronized ArrayList getWorldBlockLightPosList() { // only populate the list once if (this.blockLightPosList == null) @@ -479,7 +479,13 @@ public class ChunkWrapper implements IChunkWrapper #else this.chunk.findBlockLightSources((blockPos, blockState) -> { - this.blockLightPosList.add(new DhBlockPos(blockPos.getX(), blockPos.getY(), blockPos.getZ())); + DhBlockPos pos = new DhBlockPos(blockPos.getX(), blockPos.getY(), blockPos.getZ()); + + // this can be uncommented if MC decides to return relative block positions in the future instead of world positions + //pos.mutateToChunkRelativePos(pos); + //pos.mutateOffset(this.chunkPos.getMinBlockX(), 0, this.chunkPos.getMinBlockZ(), pos); + + this.blockLightPosList.add(pos); }); #endif } diff --git a/coreSubProjects b/coreSubProjects index 1d6d71248..ed39b6181 160000 --- a/coreSubProjects +++ b/coreSubProjects @@ -1 +1 @@ -Subproject commit 1d6d712483af18c7fb528faf8570753d7f1e757b +Subproject commit ed39b6181f3e291f917c0b68ab20358c89db2b34