13
0
geforkt von Mirrors/Paper

Use getChunkForLighting instead of getChunkAtImmediately in fixlight to properly ignore imposter chunks

We need chunks to actually have their light status future done to relight them, an imposter with for example only the empty future complete but with a light status cannot be relit.

getChunkForLighting gives the desired behavior and is the method used by the light engine, so updating fixlight to use it as well fixes #8115
Dieser Commit ist enthalten in:
Jason Penilla 2022-07-08 15:27:37 -07:00
Ursprung 16c0d71b99
Commit 21e92425e9

Datei anzeigen

@ -4374,7 +4374,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ for (java.util.Iterator<ChunkPos> iterator = chunks.iterator(); iterator.hasNext();) {
+ final ChunkPos chunkPos = iterator.next();
+
+ final net.minecraft.world.level.chunk.ChunkAccess chunk = world.getChunkSource().getChunkAtImmediately(chunkPos.x, chunkPos.z);
+ final net.minecraft.world.level.chunk.ChunkAccess chunk = (net.minecraft.world.level.chunk.ChunkAccess) world.getChunkSource().getChunkForLighting(chunkPos.x, chunkPos.z);
+ if (chunk == null || !chunk.isLightCorrect() || !chunk.getStatus().isOrAfter(net.minecraft.world.level.chunk.ChunkStatus.LIGHT)) {
+ // cannot relight this chunk
+ iterator.remove();
@ -4536,7 +4536,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ for (java.util.Iterator<ChunkPos> iterator = chunks.iterator(); iterator.hasNext();) {
+ final ChunkPos chunkPos = iterator.next();
+
+ final ChunkAccess chunk = ((ServerLevel)this.theLightEngine.getWorld()).getChunkSource().getChunkAtImmediately(chunkPos.x, chunkPos.z);
+ final ChunkAccess chunk = (ChunkAccess)((ServerLevel)this.theLightEngine.getWorld()).getChunkSource().getChunkForLighting(chunkPos.x, chunkPos.z);
+ if (chunk == null || !chunk.isLightCorrect() || !chunk.getStatus().isOrAfter(ChunkStatus.LIGHT)) {
+ // cannot relight this chunk
+ iterator.remove();