Readd chunk priority patch, including many chunk system fixes from tuinity (#6488)

This commit is contained in:
Spottedleaf
2021-08-25 19:16:27 -07:00
parent 7a51a16318
commit 4355a3ac96
20 changed files with 1890 additions and 119 deletions

View File

@@ -2418,7 +2418,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ }
+
+ com.destroystokyo.paper.io.PaperFileIOThread.Holder.INSTANCE.scheduleSave(this.level, chunkPos.x, chunkPos.z,
+ poiData, null, com.destroystokyo.paper.io.PrioritizedTaskQueue.LOW_PRIORITY);
+ poiData, null, com.destroystokyo.paper.io.PrioritizedTaskQueue.NORMAL_PRIORITY);
+
+ if (!chunk.isUnsaved()) {
+ return;
@@ -2439,7 +2439,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ asyncSaveData = ChunkSerializer.getAsyncSaveData(this.level, chunk);
+ }
+
+ this.level.asyncChunkTaskManager.scheduleChunkSave(chunkPos.x, chunkPos.z, com.destroystokyo.paper.io.PrioritizedTaskQueue.LOW_PRIORITY,
+ this.level.asyncChunkTaskManager.scheduleChunkSave(chunkPos.x, chunkPos.z, com.destroystokyo.paper.io.PrioritizedTaskQueue.NORMAL_PRIORITY,
+ asyncSaveData, chunk);
+
+ chunk.setUnsaved(false);
@@ -2954,7 +2954,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ data = this.getData(chunkcoordintpair);
+ }
+ com.destroystokyo.paper.io.PaperFileIOThread.Holder.INSTANCE.scheduleSave(this.world,
+ chunkcoordintpair.x, chunkcoordintpair.z, data, null, com.destroystokyo.paper.io.PrioritizedTaskQueue.LOW_PRIORITY);
+ chunkcoordintpair.x, chunkcoordintpair.z, data, null, com.destroystokyo.paper.io.PrioritizedTaskQueue.NORMAL_PRIORITY);
+ }
+ // Paper end
this.distanceTracker.runAllUpdates();