From 3f7c1464c892ea3ae00ba0273b79f04c7dfca037 Mon Sep 17 00:00:00 2001 From: Noah van der Aa Date: Sat, 4 Dec 2021 14:24:40 +0100 Subject: [PATCH] Don't get block light level if the sky level is 15 (#6922) --- patches/server/Rewrite-the-light-engine.patch | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/patches/server/Rewrite-the-light-engine.patch b/patches/server/Rewrite-the-light-engine.patch index 23839b1f3..69f3fe746 100644 --- a/patches/server/Rewrite-the-light-engine.patch +++ b/patches/server/Rewrite-the-light-engine.patch @@ -3341,6 +3341,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + final ChunkAccess chunk = this.getAnyChunkNow(pos.getX() >> 4, pos.getZ() >> 4); + + final int sky = this.getSkyLightValue(pos, chunk) - ambientDarkness; ++ // Don't fetch the block light level if the skylight level is 15, since the value will never be higher. ++ if (sky == 15) return 15; + final int block = this.getBlockLightValue(pos, chunk); + return Math.max(sky, block); + } @@ -4612,6 +4614,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + public int getRawBrightness(final BlockPos pos, final int ambientDarkness) { + // need to use new light hooks for this + final int sky = this.theLightEngine.getSkyReader().getLightValue(pos) - ambientDarkness; ++ // Don't fetch the block light level if the skylight level is 15, since the value will never be higher. ++ if (sky == 15) return 15; + final int block = this.theLightEngine.getBlockReader().getLightValue(pos); + return Math.max(sky, block); + }