From c537084d072463a139e8592110b3109467e01d5f Mon Sep 17 00:00:00 2001 From: cola98765 Date: Tue, 19 Mar 2024 12:27:05 +0000 Subject: [PATCH] potential fix to bright blocks when they reach build height limit --- .../transformers/LodDataBuilder.java | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/core/src/main/java/com/seibel/distanthorizons/core/dataObjects/transformers/LodDataBuilder.java b/core/src/main/java/com/seibel/distanthorizons/core/dataObjects/transformers/LodDataBuilder.java index a4c326cba..2a3346f03 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/dataObjects/transformers/LodDataBuilder.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/dataObjects/transformers/LodDataBuilder.java @@ -136,9 +136,22 @@ public class LodDataBuilder IBiomeWrapper biome = chunkWrapper.getBiome(chunkX, lastY, chunkZ); IBlockStateWrapper blockState = AIR; int mappedId = dataSource.mapping.addIfNotPresentAndGetId(biome, blockState); - // FIXME: The lastY +1 offset is to reproduce the old behavior. Remove this when we get per-face lighting - byte blockLight = (byte) chunkWrapper.getBlockLight(chunkX, lastY + 1, chunkZ); - byte skyLight = (byte) chunkWrapper.getSkyLight(chunkX, lastY + 1, chunkZ); + + + byte blockLight; + byte skyLight; + if (lastY < chunkWrapper.getMaxBuildHeight()) + { + // FIXME: The lastY +1 offset is to reproduce the old behavior. Remove this when we get per-face lighting + blockLight = (byte) chunkWrapper.getBlockLight(chunkX, lastY + 1, chunkZ); + skyLight = (byte) chunkWrapper.getSkyLight(chunkX, lastY + 1, chunkZ); + } + else + { + //we are at the height limit. There are no torches here, and sky is not obscured. + blockLight = 0; + skyLight = 15; + } // determine the starting Y Pos