diff --git a/bukkit/src/main/java/net/momirealms/craftengine/bukkit/world/BukkitWorldManager.java b/bukkit/src/main/java/net/momirealms/craftengine/bukkit/world/BukkitWorldManager.java index 5acc2739e..ea4ab38e3 100644 --- a/bukkit/src/main/java/net/momirealms/craftengine/bukkit/world/BukkitWorldManager.java +++ b/bukkit/src/main/java/net/momirealms/craftengine/bukkit/world/BukkitWorldManager.java @@ -16,6 +16,7 @@ import net.momirealms.craftengine.core.world.SectionPos; import net.momirealms.craftengine.core.world.WorldManager; import net.momirealms.craftengine.core.world.chunk.CEChunk; import net.momirealms.craftengine.core.world.chunk.CESection; +import net.momirealms.craftengine.core.world.chunk.PalettedContainer; import net.momirealms.craftengine.core.world.chunk.storage.DefaultStorageAdaptor; import net.momirealms.craftengine.core.world.chunk.storage.StorageAdaptor; import net.momirealms.craftengine.core.world.chunk.storage.WorldDataStorage; @@ -346,14 +347,15 @@ public class BukkitWorldManager implements WorldManager, Listener { boolean isEmptyBefore = FastNMS.INSTANCE.method$LevelSection$hasOnlyAir(section); int sectionY = ceSection.sectionY; // 有自定义方块 - if (!ceSection.statesContainer().isEmpty()) { + PalettedContainer palettedContainer = ceSection.statesContainer(); + if (!palettedContainer.isEmpty()) { if (isEmptyBefore) { FastNMS.INSTANCE.method$LightEventListener$updateSectionStatus(lightEngine, FastNMS.INSTANCE.method$SectionPos$of(chunkX, sectionY, chunkZ), false); } for (int x = 0; x < 16; x++) { for (int z = 0; z < 16; z++) { for (int y = 0; y < 16; y++) { - ImmutableBlockState customState = ceSection.getBlockState(x, y, z); + ImmutableBlockState customState = palettedContainer.get(x, y, z); if (!customState.isEmpty() && customState.customBlockState() != null) { Object newState = customState.customBlockState().literalObject(); Object previous = FastNMS.INSTANCE.method$LevelChunkSection$setBlockState(section, x, y, z, newState, false);