diff --git a/Spigot-Server-Patches/ChunkMap-caching.patch b/Spigot-Server-Patches/ChunkMap-caching.patch index 635faac66b..56737cd3e2 100644 --- a/Spigot-Server-Patches/ChunkMap-caching.patch +++ b/Spigot-Server-Patches/ChunkMap-caching.patch @@ -16,9 +16,15 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + private PacketPlayOutMapChunk.ChunkMap chunkMap; + private int emptySectionBits; + -+ public PacketPlayOutMapChunk.ChunkMap getChunkMap() { -+ if (!world.paperSpigotConfig.cacheChunkMaps) { -+ return PacketPlayOutMapChunk.a(this, true, !world.worldProvider.o(), '\uffff'); ++ public PacketPlayOutMapChunk.ChunkMap getChunkMap(boolean groundUpContinuous, int primaryBitMask) { ++ if (!world.paperSpigotConfig.cacheChunkMaps || !groundUpContinuous || (primaryBitMask != 0 && primaryBitMask != '\uffff')) { ++ return PacketPlayOutMapChunk.a(this, groundUpContinuous, !world.worldProvider.o(), primaryBitMask); ++ } ++ ++ if (primaryBitMask == 0) { ++ PacketPlayOutMapChunk.ChunkMap chunkMap = new PacketPlayOutMapChunk.ChunkMap(); ++ chunkMap.a = new byte[0]; ++ return chunkMap; + } + + boolean isDirty = false; @@ -97,7 +103,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 this.b = chunk.locZ; this.d = flag; - this.c = a(chunk, flag, !chunk.getWorld().worldProvider.o(), i); -+ this.c = chunk.getChunkMap(); // PaperSpigot ++ this.c = chunk.getChunkMap(flag, i); // PaperSpigot chunk.world.spigotConfig.antiXrayInstance.obfuscateSync(chunk.locX, chunk.locZ, c.b, c.a, chunk.world); } @@ -110,7 +116,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 for (int j = 0; j < i; ++j) { Chunk chunk = (Chunk) list.get(j); - PacketPlayOutMapChunk.ChunkMap packetplayoutmapchunk_chunkmap = PacketPlayOutMapChunk.a(chunk, true, this.d, '\uffff'); -+ PacketPlayOutMapChunk.ChunkMap packetplayoutmapchunk_chunkmap = chunk.getChunkMap(); // PaperSpigot ++ PacketPlayOutMapChunk.ChunkMap packetplayoutmapchunk_chunkmap = chunk.getChunkMap(true, '\uffff'); // PaperSpigot this.a[j] = chunk.locX; this.b[j] = chunk.locZ;