2019-04-23 05:36:14 +08:00
|
|
|
From 745f1a69fc7480310f06db300dd9b112b92ceb00 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
|
2019-04-23 05:36:14 +08:00
|
|
|
index 0fc4d9f520..2c4a4fc6b7 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
|
2019-01-05 03:19:36 +08:00
|
|
|
@@ -304,6 +304,7 @@ public class ChunkRegionLoader implements IChunkLoader, IAsyncChunkSaver {
|
2018-07-23 09:25:48 +08:00
|
|
|
}
|
|
|
|
|
2018-08-27 02:11:49 +08:00
|
|
|
public 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
|
2019-04-23 05:36:14 +08:00
|
|
|
index 70a95c2636..56958a5ce3 100644
|
2018-07-24 07:41:29 +08:00
|
|
|
--- a/src/main/java/net/minecraft/server/ChunkTaskScheduler.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/ChunkTaskScheduler.java
|
2019-01-01 11:15:55 +08:00
|
|
|
@@ -21,7 +21,7 @@ public class ChunkTaskScheduler extends Scheduler<ChunkCoordIntPair, ChunkStatus
|
|
|
|
protected boolean a(Scheduler<ChunkCoordIntPair, ChunkStatus, ProtoChunk>.a scheduler_a) {
|
2018-07-24 07:41:29 +08:00
|
|
|
ProtoChunk protochunk = (ProtoChunk) scheduler_a.a();
|
|
|
|
|
|
|
|
- return !protochunk.ab_() && !protochunk.h();
|
|
|
|
+ return !protochunk.ab_() /*&& !protochunk.h()*/; // Paper
|
|
|
|
}
|
2018-08-27 02:11:49 +08:00
|
|
|
};
|
2018-07-24 07:41:29 +08:00
|
|
|
|
2019-01-01 11:15:55 +08:00
|
|
|
@@ -85,6 +85,7 @@ public class ChunkTaskScheduler extends Scheduler<ChunkCoordIntPair, ChunkStatus
|
2018-08-27 02:11:49 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
public void a(BooleanSupplier booleansupplier) {
|
|
|
|
+ if (true) return; // Paper - we don't save proto chunks, and don't want to block thread
|
|
|
|
IChunkLoader ichunkloader = this.e;
|
|
|
|
|
|
|
|
synchronized (this.e) {
|
2018-07-23 09:25:48 +08:00
|
|
|
--
|
2019-03-20 09:46:00 +08:00
|
|
|
2.21.0
|
2018-07-23 09:25:48 +08:00
|
|
|
|