2018-07-24 07:41:29 +08:00
|
|
|
From 114ef33e651ac74cef786afa84ff16003b0cccfb Mon Sep 17 00:00:00 2001
|
2018-07-23 09:25:48 +08:00
|
|
|
From: Aikar <aikar@aikar.co>
|
|
|
|
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/ChunkRegionLoader.java b/src/main/java/net/minecraft/server/ChunkRegionLoader.java
|
2018-07-24 07:41:29 +08:00
|
|
|
index ea8684747..a97e024ec 100644
|
2018-07-23 09:25:48 +08:00
|
|
|
--- 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 {
|
2018-07-23 10:33:43 +08:00
|
|
|
+ if (ichunkaccess.i().d() == ChunkStatus.Type.PROTOCHUNK) { return; } // Paper - don't save proto chunks
|
2018-07-23 09:25:48 +08:00
|
|
|
// Spigot end
|
|
|
|
world.checkSession();
|
|
|
|
|
2018-07-24 07:41:29 +08:00
|
|
|
diff --git a/src/main/java/net/minecraft/server/ChunkTaskScheduler.java b/src/main/java/net/minecraft/server/ChunkTaskScheduler.java
|
|
|
|
index 501565dd5..7b3068753 100644
|
|
|
|
--- a/src/main/java/net/minecraft/server/ChunkTaskScheduler.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/ChunkTaskScheduler.java
|
|
|
|
@@ -23,7 +23,7 @@ public class ChunkTaskScheduler extends Scheduler<ChunkCoordIntPair, ChunkStatus
|
|
|
|
protected boolean a(Scheduler.a scheduler_a) {
|
|
|
|
ProtoChunk protochunk = (ProtoChunk) scheduler_a.a();
|
|
|
|
|
|
|
|
- return !protochunk.ab_() && !protochunk.h();
|
|
|
|
+ return !protochunk.ab_() /*&& !protochunk.h()*/; // Paper
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
2018-07-23 09:25:48 +08:00
|
|
|
--
|
|
|
|
2.18.0
|
|
|
|
|