diff --git a/core/src/main/java/com/seibel/distanthorizons/core/generation/DhLightingEngine.java b/core/src/main/java/com/seibel/distanthorizons/core/generation/DhLightingEngine.java index ac2e674b1..42ba358e4 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/generation/DhLightingEngine.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/generation/DhLightingEngine.java @@ -179,6 +179,13 @@ public class DhLightingEngine continue; } + if (relNeighbourBlockPos.y < neighbourChunk.getMinBuildHeight() || relNeighbourBlockPos.y > neighbourChunk.getMaxBuildHeight()) + { + // the light pos is outside the chunk's min/max height, + // this can happen if given a chunk that hasn't finished generating + continue; + } + int currentBlockLight = getLightFunc.getLight(neighbourChunk, relNeighbourBlockPos); if (currentBlockLight >= (lightValue - 1))