2021-12-09 13:09:31 +01:00
|
|
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
|
|
From: Jason Penilla <11360596+jpenilla@users.noreply.github.com>
|
|
|
|
Date: Thu, 9 Dec 2021 00:08:11 -0800
|
|
|
|
Subject: [PATCH] Fix ChunkSnapshot#isSectionEmpty(int)
|
|
|
|
|
|
|
|
|
|
|
|
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftChunk.java b/src/main/java/org/bukkit/craftbukkit/CraftChunk.java
|
2021-12-09 13:34:11 +01:00
|
|
|
index db344e5b9f96f317a232304587e6b1673fc6067d..b4f7b91ac165e3171ffcf7d6a993af248d268959 100644
|
2021-12-09 13:09:31 +01:00
|
|
|
--- a/src/main/java/org/bukkit/craftbukkit/CraftChunk.java
|
|
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/CraftChunk.java
|
2021-12-09 13:34:11 +01:00
|
|
|
@@ -286,8 +286,15 @@ public class CraftChunk implements Chunk {
|
2021-12-09 13:09:31 +01:00
|
|
|
for (int i = 0; i < cs.length; i++) {
|
2021-12-09 13:34:11 +01:00
|
|
|
CompoundTag data = new CompoundTag();
|
|
|
|
|
2021-12-09 13:09:31 +01:00
|
|
|
+ // Paper start
|
2021-12-09 13:34:11 +01:00
|
|
|
+ sectionEmpty[i] = cs[i].hasOnlyAir();
|
|
|
|
+ if (!sectionEmpty[i]) {
|
|
|
|
data.put("block_states", ChunkSerializer.BLOCK_STATE_CODEC.encodeStart(NbtOps.INSTANCE, cs[i].getStates()).get().left().get());
|
|
|
|
sectionBlockIDs[i] = ChunkSerializer.BLOCK_STATE_CODEC.parse(NbtOps.INSTANCE, data.getCompound("block_states")).get().left().get();
|
2021-12-09 13:09:31 +01:00
|
|
|
+ } else {
|
2021-12-09 13:34:11 +01:00
|
|
|
+ sectionBlockIDs[i] = CraftChunk.emptyBlockIDs;
|
2021-12-09 13:09:31 +01:00
|
|
|
+ }
|
|
|
|
+ // Paper end
|
|
|
|
|
2021-12-09 13:34:11 +01:00
|
|
|
LevelLightEngine lightengine = chunk.level.getLightEngine();
|
|
|
|
DataLayer skyLightArray = lightengine.getLayerListener(LightLayer.SKY).getDataLayerData(SectionPos.of(x, i, z));
|