Skip to content

Commit 7cb97dc

Browse files
Fixed Bulk Chunk 1.7 <-> 1.8 skylight reading
1 parent 69363c8 commit 7cb97dc

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

common/src/main/java/com/viaversion/viarewind/protocol/protocol1_7_6_10to1_8/types/chunk/BulkChunkType1_7_6.java

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package com.viaversion.viarewind.protocol.protocol1_7_6_10to1_8.types.chunk;
22

33
import com.viaversion.viaversion.api.minecraft.chunks.Chunk;
4+
import com.viaversion.viaversion.api.minecraft.chunks.ChunkSection;
45
import com.viaversion.viaversion.api.type.Type;
56
import com.viaversion.viaversion.util.Pair;
67
import io.netty.buffer.ByteBuf;
@@ -55,7 +56,18 @@ public void write(ByteBuf byteBuf, Chunk[] chunks) throws Exception {
5556

5657
byteBuf.writeShort(chunkCount);
5758
byteBuf.writeInt(compressedSize);
58-
byteBuf.writeBoolean(true); // hasSkyLight
59+
60+
boolean skyLight = false;
61+
for (Chunk chunk : chunks) {
62+
for (ChunkSection section : chunk.getSections()) {
63+
if (section != null && section.getLight().hasSkyLight()) {
64+
skyLight = true;
65+
break;
66+
}
67+
}
68+
}
69+
70+
byteBuf.writeBoolean(skyLight); // hasSkyLight
5971
byteBuf.writeBytes(compressedData, 0, compressedSize);
6072

6173
for (int i = 0; i < chunkCount; i++) {

0 commit comments

Comments
 (0)