From 766c831af0ef3dbc51a386569f6b1d78e68de654 Mon Sep 17 00:00:00 2001 From: James Seibel Date: Fri, 24 Jan 2025 07:22:11 -0600 Subject: [PATCH] fix recalculate heightmap breaking stairs, slabs, and glass --- .../core/dataObjects/transformers/LodDataBuilder.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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 5fa752be5..3fa55a3af 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 @@ -175,7 +175,12 @@ public class LodDataBuilder // determine the starting Y Pos - int y = chunkWrapper.getLightBlockingHeightMapValue(relBlockX, relBlockZ); + int y = Math.max( + // max between both heightmaps to account for solid invisible blocks (glass) + // and non-solid opaque blocks (at one point this was stairs, not sure what would fit this now) + chunkWrapper.getLightBlockingHeightMapValue(relBlockX, relBlockZ), + chunkWrapper.getSolidHeightMapValue(relBlockX, relBlockZ) + ); // go up until we reach open air or the world limit IBlockStateWrapper topBlockState = previousBlockState = chunkWrapper.getBlockState(relBlockX, y, relBlockZ, mcBlockPos, previousBlockState); while (!topBlockState.isAir() && y < chunkWrapper.getExclusiveMaxBuildHeight())