Fix DhLightingEngine for light positions outside the chunk(s)

This commit is contained in:
James Seibel
2023-08-13 17:09:03 -05:00
parent 8df8ed4a02
commit f67949dbc4
@@ -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))