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

This commit is contained in:
MetallicGoat 2024-05-23 21:14:56 +10:00 committed by md_5
parent 87d0a3368a
commit a43701920b
No known key found for this signature in database
GPG Key ID: E8E901AC7C617C11

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