From dda43c2566fe46e7ba3948e5ec0727683ccd3fdf Mon Sep 17 00:00:00 2001 From: Aikar Date: Sun, 22 Jul 2018 21:25:48 -0400 Subject: [PATCH] Don't save Proto Chunks These chunks are unfinished, and waste cpu time saving these unfinished chunks. the loadChunk method refuses to acknoledge they exists, and will restart a new chunk generation process to begin with, so saving them serves no benefit. --- .../0307-Don-t-save-Proto-Chunks.patch | 46 +++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 Spigot-Server-Patches/0307-Don-t-save-Proto-Chunks.patch diff --git a/Spigot-Server-Patches/0307-Don-t-save-Proto-Chunks.patch b/Spigot-Server-Patches/0307-Don-t-save-Proto-Chunks.patch new file mode 100644 index 000000000..808e7996f --- /dev/null +++ b/Spigot-Server-Patches/0307-Don-t-save-Proto-Chunks.patch @@ -0,0 +1,46 @@ +From 5fcdb15e3e736e338a24f294f5f59e8a255d9080 Mon Sep 17 00:00:00 2001 +From: Aikar +Date: Sun, 22 Jul 2018 21:21:41 -0400 +Subject: [PATCH] Don't save Proto Chunks + +These chunks are unfinished, and waste cpu time saving these unfinished chunks. +the loadChunk method refuses to acknoledge they exists, and will restart +a new chunk generation process to begin with, so saving them serves no benefit. + +diff --git a/src/main/java/net/minecraft/server/ChunkProviderServer.java b/src/main/java/net/minecraft/server/ChunkProviderServer.java +index fd8430a68..b425704b1 100644 +--- a/src/main/java/net/minecraft/server/ChunkProviderServer.java ++++ b/src/main/java/net/minecraft/server/ChunkProviderServer.java +@@ -250,7 +250,7 @@ public class ChunkProviderServer implements IChunkProvider { + public boolean a(boolean flag) { + int i = 0; + +- this.f.a(); ++ //this.f.a(); // Paper - don't save proto chunks + ArrayList arraylist = Lists.newArrayList(this.chunks.values()); + Iterator iterator = arraylist.iterator(); + +@@ -369,7 +369,7 @@ public class ChunkProviderServer implements IChunkProvider { + } + // Paper end + +- this.f.a(); ++ //this.f.a(); // Paper - don't save proto chunks + this.chunkLoader.b(); + } + +diff --git a/src/main/java/net/minecraft/server/ChunkRegionLoader.java b/src/main/java/net/minecraft/server/ChunkRegionLoader.java +index ea8684747..7acb3744d 100644 +--- a/src/main/java/net/minecraft/server/ChunkRegionLoader.java ++++ b/src/main/java/net/minecraft/server/ChunkRegionLoader.java +@@ -282,6 +282,7 @@ public class ChunkRegionLoader implements IChunkLoader, IAsyncChunkSaver { + } + + public synchronized void saveChunk(World world, IChunkAccess ichunkaccess, boolean unloaded) throws IOException, ExceptionWorldConflict { ++ if (ichunkaccess.i().d() == ChunkStatus.Type.PROTOCHUNK) { new Throwable().printStackTrace(); return; } // Paper - don't save proto chunks + // Spigot end + world.checkSession(); + +-- +2.18.0 +