#1402: Fix ChunkSnapshot#isSectionEmpty() is always false

By: MetallicGoat <the.great.metallic.goat@gmail.com>
This commit is contained in:
CraftBukkit/Spigot 2024-05-23 21:14:56 +10:00
parent 60c7d83e00
commit 6f5d01226e

View file

@ -317,6 +317,7 @@ public class CraftChunk implements Chunk {
data.put("block_states", ChunkRegionLoader.BLOCK_STATE_CODEC.encodeStart(DynamicOpsNBT.INSTANCE, cs[i].getStates()).getOrThrow());
sectionBlockIDs[i] = ChunkRegionLoader.BLOCK_STATE_CODEC.parse(DynamicOpsNBT.INSTANCE, data.getCompound("block_states")).getOrThrow(ChunkRegionLoader.a::new);
sectionEmpty[i] = cs[i].hasOnlyAir();
LevelLightEngine lightengine = worldServer.getLightEngine();
NibbleArray skyLightArray = lightengine.getLayerListener(EnumSkyBlock.SKY).getDataLayerData(SectionPosition.of(x, chunk.getSectionYFromSectionIndex(i), z)); // SPIGOT-7498: Convert section index