mirror of
https://github.com/PaperMC/Paper.git
synced 2025-04-04 19:15:45 +02:00
Add more to the save fixes
- Set forceTicks to true, so that player packets are always processed so that the main process queue can be drained
This commit is contained in:
parent
01b6bc66db
commit
ffe0d7b99c
@ -8,6 +8,8 @@ Subject: [PATCH] Fix save problems on shutdown
|
|||||||
while waiting for the chunk system to empty, as there's simply
|
while waiting for the chunk system to empty, as there's simply
|
||||||
too much trash that could prevent them from executing during
|
too much trash that could prevent them from executing during
|
||||||
the chunk source tick (i.e "time left in tick" logic).
|
the chunk source tick (i.e "time left in tick" logic).
|
||||||
|
- Set forceTicks to true, so that player packets are always
|
||||||
|
processed so that the main process queue can be drained
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||||
@ -35,10 +37,23 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||||||
}
|
}
|
||||||
|
|
||||||
- this.waitUntilNextTick();
|
- this.waitUntilNextTick();
|
||||||
|
+ this.forceTicks = true; // Paper
|
||||||
+ while (this.pollTask()); // Paper - drain tasks
|
+ while (this.pollTask()); // Paper - drain tasks
|
||||||
}
|
}
|
||||||
|
|
||||||
this.saveAllChunks(false, true, false);
|
this.saveAllChunks(false, true, false);
|
||||||
|
@@ -0,0 +0,0 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||||
|
}
|
||||||
|
|
||||||
|
private boolean haveTime() {
|
||||||
|
+ // Paper start
|
||||||
|
+ if (this.forceTicks) {
|
||||||
|
+ return true;
|
||||||
|
+ }
|
||||||
|
+ // Paper end
|
||||||
|
// CraftBukkit start
|
||||||
|
if (isOversleep) return canOversleep();// Paper - because of our changes, this logic is broken
|
||||||
|
return this.forceTicks || this.runningTask() || Util.getMillis() < (this.mayHaveDelayedTasks ? this.delayedTasksMaxNextTickTime : this.nextTickTime);
|
||||||
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||||
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
|
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||||
|
Loading…
Reference in New Issue
Block a user