Mirror von
https://github.com/PaperMC/Paper.git
synchronisiert 2024-11-15 12:30:06 +01:00
046466f3ba
* Re-arrange most chunk system patches to front Co-authored-by: Spottedleaf <Spottedleaf@users.noreply.github.com>
27 Zeilen
1.3 KiB
Diff
27 Zeilen
1.3 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: Spottedleaf <Spottedleaf@users.noreply.github.com>
|
|
Date: Mon, 1 Feb 2021 15:35:14 -0800
|
|
Subject: [PATCH] Fix chunks refusing to unload at low TPS
|
|
|
|
The full chunk future is appended to the chunk save future, but
|
|
when moving to unloaded ticket level it is not being completed with
|
|
the empty chunk access, so the chunk save must wait for the full
|
|
chunk future to complete. We can simply schedule to the immediate
|
|
executor to get this effect, rather than the main mailbox.
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
|
|
index 5a78ee69748b2b7b57a9adcff0a4718b1cc0c4ea..a3fceb2608b3be80941dfe2570999b270429e0c6 100644
|
|
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
|
|
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
|
|
@@ -1352,9 +1352,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
|
|
|
return chunk;
|
|
});
|
|
- }, (runnable) -> {
|
|
- this.mainThreadMailbox.tell(ChunkTaskPriorityQueueSorter.message(holder, runnable));
|
|
- });
|
|
+ }, this.mainThreadExecutor); // Paper - queue to execute immediately so this doesn't delay chunk unloading
|
|
}
|
|
|
|
public int getTickingGenerated() {
|