From 905d8bddf303469a7522902b1243d20ba46d8693 Mon Sep 17 00:00:00 2001 From: cola98765 Date: Thu, 14 Oct 2021 18:56:51 +0200 Subject: [PATCH] made new sky lighting calculation optional with internal boolean --- .../lod/builders/lodBuilding/LodBuilder.java | 33 +++++++++++++++---- 1 file changed, 26 insertions(+), 7 deletions(-) diff --git a/src/main/java/com/seibel/lod/builders/lodBuilding/LodBuilder.java b/src/main/java/com/seibel/lod/builders/lodBuilding/LodBuilder.java index 0ef2e9402..570af97b7 100644 --- a/src/main/java/com/seibel/lod/builders/lodBuilding/LodBuilder.java +++ b/src/main/java/com/seibel/lod/builders/lodBuilding/LodBuilder.java @@ -91,6 +91,8 @@ public class LodBuilder */ public int defaultDimensionWidthInRegions = 0; + public static final boolean useExperimentalLighting = false; + @@ -444,15 +446,32 @@ public class LodBuilder skyLight = DEFAULT_MAX_LIGHT; else { - skyLight = world.getBrightness(LightType.SKY, blockPos); - if (!chunk.isLightCorrect() && (skyLight <= 0 || skyLight >= 15)) + if (useExperimentalLighting) { - // we don't know what the light here is, - // lets just take a guess - if (blockPos.getY() >= mc.getClientWorld().getSeaLevel() - 5) - skyLight = 13; + skyLight = world.getBrightness(LightType.SKY, blockPos); + if (!chunk.isLightCorrect() && (skyLight <= 0 || skyLight >= 15)) + { + // we don't know what the light here is, + // lets just take a guess + if (blockPos.getY() >= mc.getClientWorld().getSeaLevel() - 5) + skyLight = 13; + else + skyLight = 0; + } + } + else + { + if (chunk.isLightCorrect()) + skyLight = world.getBrightness(LightType.SKY, blockPos); else - skyLight = 0; + { + // we don't know what the light here is, + // lets just take a guess + if (blockPos.getY() >= mc.getClientWorld().getSeaLevel() - 5) + skyLight = 13; + else + skyLight = 0; + } } }