aboutsummaryrefslogtreecommitdiffhomepage
path: root/patches/server/0648-Fix-ChunkSnapshot-isSectionEmpty-int-and-optimize-Pa.patch
diff options
context:
space:
mode:
Diffstat (limited to 'patches/server/0648-Fix-ChunkSnapshot-isSectionEmpty-int-and-optimize-Pa.patch')
-rw-r--r--patches/server/0648-Fix-ChunkSnapshot-isSectionEmpty-int-and-optimize-Pa.patch7
1 files changed, 4 insertions, 3 deletions
diff --git a/patches/server/0648-Fix-ChunkSnapshot-isSectionEmpty-int-and-optimize-Pa.patch b/patches/server/0648-Fix-ChunkSnapshot-isSectionEmpty-int-and-optimize-Pa.patch
index 239a0c56cc..96c1914907 100644
--- a/patches/server/0648-Fix-ChunkSnapshot-isSectionEmpty-int-and-optimize-Pa.patch
+++ b/patches/server/0648-Fix-ChunkSnapshot-isSectionEmpty-int-and-optimize-Pa.patch
@@ -6,10 +6,10 @@ Subject: [PATCH] Fix ChunkSnapshot#isSectionEmpty(int) and optimize
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftChunk.java b/src/main/java/org/bukkit/craftbukkit/CraftChunk.java
-index fc335e4e80553e8c6c915e7813e9610ac10649c2..5b59b19a6d913ebdfc28a755e3a1a8b8384a3116 100644
+index 01596f87ee078fceeb3f2f29bbb2500e63e9efb8..f8c2d91958d6e4a1452fcf32c16fa8b97ea271a2 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftChunk.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftChunk.java
-@@ -337,13 +337,17 @@ public class CraftChunk implements Chunk {
+@@ -338,14 +338,17 @@ public class CraftChunk implements Chunk {
PalettedContainerRO<Holder<net.minecraft.world.level.biome.Biome>>[] biome = (includeBiome || includeBiomeTempRain) ? new PalettedContainer[cs.length] : null;
Registry<net.minecraft.world.level.biome.Biome> iregistry = this.worldServer.registryAccess().registryOrThrow(Registries.BIOME);
@@ -20,6 +20,7 @@ index fc335e4e80553e8c6c915e7813e9610ac10649c2..5b59b19a6d913ebdfc28a755e3a1a8b8
- data.put("block_states", ChunkSerializer.BLOCK_STATE_CODEC.encodeStart(NbtOps.INSTANCE, cs[i].getStates()).getOrThrow());
- sectionBlockIDs[i] = ChunkSerializer.BLOCK_STATE_CODEC.parse(NbtOps.INSTANCE, data.getCompound("block_states")).getOrThrow(ChunkSerializer.ChunkReadException::new);
+- sectionEmpty[i] = cs[i].hasOnlyAir();
+ // Paper start - Fix ChunkSnapshot#isSectionEmpty(int); and remove codec usage
+ sectionEmpty[i] = cs[i].hasOnlyAir(); // fix sectionEmpty array not being filled
+ if (!sectionEmpty[i]) {
@@ -31,7 +32,7 @@ index fc335e4e80553e8c6c915e7813e9610ac10649c2..5b59b19a6d913ebdfc28a755e3a1a8b8
LevelLightEngine lightengine = this.worldServer.getLightEngine();
DataLayer skyLightArray = lightengine.getLayerListener(LightLayer.SKY).getDataLayerData(SectionPos.of(this.x, chunk.getSectionYFromSectionIndex(i), this.z)); // SPIGOT-7498: Convert section index
-@@ -362,8 +366,7 @@ public class CraftChunk implements Chunk {
+@@ -364,8 +367,7 @@ public class CraftChunk implements Chunk {
}
if (biome != null) {