2018-12-15 01:17:27 +00:00
|
|
|
From 2db9c766c78caaeabd0d2e76a48aed03e7e45ee5 Mon Sep 17 00:00:00 2001
|
2018-07-23 01:25:48 +00: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-12-15 01:17:27 +00:00
|
|
|
index 34ddf655e..3b36a32c6 100644
|
2018-07-23 01:25:48 +00:00
|
|
|
--- a/src/main/java/net/minecraft/server/ChunkRegionLoader.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/ChunkRegionLoader.java
|
2018-09-27 02:35:42 +00:00
|
|
|
@@ -300,6 +300,7 @@ public class ChunkRegionLoader implements IChunkLoader, IAsyncChunkSaver {
|
2018-07-23 01:25:48 +00:00
|
|
|
}
|
|
|
|
|
2018-08-26 18:11:49 +00:00
|
|
|
public void saveChunk(World world, IChunkAccess ichunkaccess, boolean unloaded) throws IOException, ExceptionWorldConflict {
|
2018-07-23 02:33:43 +00:00
|
|
|
+ if (ichunkaccess.i().d() == ChunkStatus.Type.PROTOCHUNK) { return; } // Paper - don't save proto chunks
|
2018-07-23 01:25:48 +00:00
|
|
|
// Spigot end
|
|
|
|
world.checkSession();
|
|
|
|
|
2018-07-23 23:41:29 +00:00
|
|
|
diff --git a/src/main/java/net/minecraft/server/ChunkTaskScheduler.java b/src/main/java/net/minecraft/server/ChunkTaskScheduler.java
|
2018-12-15 01:17:27 +00:00
|
|
|
index 772382144..9deab61fc 100644
|
2018-07-23 23:41:29 +00:00
|
|
|
--- a/src/main/java/net/minecraft/server/ChunkTaskScheduler.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/ChunkTaskScheduler.java
|
2018-08-26 18:11:49 +00:00
|
|
|
@@ -24,7 +24,7 @@ public class ChunkTaskScheduler extends Scheduler<ChunkCoordIntPair, ChunkStatus
|
2018-07-23 23:41:29 +00:00
|
|
|
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-08-26 18:11:49 +00:00
|
|
|
};
|
2018-07-23 23:41:29 +00:00
|
|
|
|
2018-08-26 18:11:49 +00:00
|
|
|
@@ -88,6 +88,7 @@ public class ChunkTaskScheduler extends Scheduler<ChunkCoordIntPair, ChunkStatus
|
|
|
|
}
|
|
|
|
|
|
|
|
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 01:25:48 +00:00
|
|
|
--
|
2018-12-15 01:17:27 +00:00
|
|
|
2.20.0
|
2018-07-23 01:25:48 +00:00
|
|
|
|