From e3e75392323b6dc1fd504d2eb2c98ebbcfcb8c51 Mon Sep 17 00:00:00 2001 From: Byteflux Date: Wed, 15 Jul 2015 16:16:27 -0700 Subject: [PATCH] Configurable chunk map caching --- .../0065-ChunkMap-caching.patch | 25 ++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/Spigot-Server-Patches/0065-ChunkMap-caching.patch b/Spigot-Server-Patches/0065-ChunkMap-caching.patch index 007e0ccc92..e1bb9bd49f 100644 --- a/Spigot-Server-Patches/0065-ChunkMap-caching.patch +++ b/Spigot-Server-Patches/0065-ChunkMap-caching.patch @@ -1,14 +1,14 @@ -From 5cf461979b07c8b31867b7e64c36fa6bc4a2e8fa Mon Sep 17 00:00:00 2001 +From 7511cc6c50a7351c6359daa9425d119947cb4338 Mon Sep 17 00:00:00 2001 From: Iceee Date: Wed, 15 Jul 2015 02:41:12 -0700 Subject: [PATCH] ChunkMap caching diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java -index ab4de94..2b70bf4 100644 +index ab4de94..c9885ca 100644 --- a/src/main/java/net/minecraft/server/Chunk.java +++ b/src/main/java/net/minecraft/server/Chunk.java -@@ -50,6 +50,39 @@ public class Chunk { +@@ -50,6 +50,43 @@ public class Chunk { public long lightUpdateTime; // PaperSpigot end @@ -17,6 +17,10 @@ index ab4de94..2b70bf4 100644 + private int emptySectionBits; + + public PacketPlayOutMapChunk.ChunkMap getChunkMap() { ++ if (!world.paperSpigotConfig.cacheChunkMaps) { ++ return PacketPlayOutMapChunk.a(this, true, !world.worldProvider.o(), '\uffff'); ++ } ++ + boolean isDirty = false; + for (int i = 0; i < sections.length; ++i) { + ChunkSection section = sections[i]; @@ -110,6 +114,21 @@ index 10c0e34..f7e8ab3 100644 this.a[j] = chunk.locX; this.b[j] = chunk.locZ; +diff --git a/src/main/java/org/github/paperspigot/PaperSpigotWorldConfig.java b/src/main/java/org/github/paperspigot/PaperSpigotWorldConfig.java +index 9c8a01b..cde11b2 100644 +--- a/src/main/java/org/github/paperspigot/PaperSpigotWorldConfig.java ++++ b/src/main/java/org/github/paperspigot/PaperSpigotWorldConfig.java +@@ -390,4 +390,10 @@ public class PaperSpigotWorldConfig + { + mobSpawnerTickRate = getInt( "mob-spawner-tick-rate", 1 ); + } ++ ++ public boolean cacheChunkMaps; ++ private void cacheChunkMaps() ++ { ++ cacheChunkMaps = getBoolean( "cache-chunk-maps", false ); ++ } + } -- 1.9.5.msysgit.1