mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-29 12:27:59 +01:00
Don't get block light level if the sky level is 15 (#6922)
This commit is contained in:
parent
bc04c3f9bc
commit
3f7c1464c8
@ -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);
|
||||
+ }
|
||||
|
Loading…
Reference in New Issue
Block a user