aboutsummaryrefslogtreecommitdiffhomepage
path: root/patches/server/1039-Incremental-chunk-and-player-saving.patch
diff options
context:
space:
mode:
Diffstat (limited to 'patches/server/1039-Incremental-chunk-and-player-saving.patch')
-rw-r--r--patches/server/1039-Incremental-chunk-and-player-saving.patch13
1 files changed, 6 insertions, 7 deletions
diff --git a/patches/server/1039-Incremental-chunk-and-player-saving.patch b/patches/server/1039-Incremental-chunk-and-player-saving.patch
index 7e4b6dd229..d1e518c623 100644
--- a/patches/server/1039-Incremental-chunk-and-player-saving.patch
+++ b/patches/server/1039-Incremental-chunk-and-player-saving.patch
@@ -56,10 +56,10 @@ index 7e5adfddced650cf227b540f3b40573cdf5b0f7c..8160c35368fc2c52d6f4a42df27adb2e
try (co.aikar.timings.Timing ignored = MinecraftTimings.processTasksTimer.startTiming()) {
this.runAllTasks();
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
-index 46e8dd8dae25e1b2124e9c8031844fbe96eb6e1a..2766ec28f028c0bd672009928bf64c1a6e5d07d6 100644
+index 36e062d52cda00ef47ae01f9ebcd0e592be52f30..25a031c749d737cbe45cc16ad3a09cb5e46778d1 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
-@@ -1358,6 +1358,35 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
+@@ -1340,6 +1340,35 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
return !this.server.isUnderSpawnProtection(this, pos, player) && this.getWorldBorder().isWithinBounds(pos);
}
@@ -108,10 +108,10 @@ index dddd4fcdcd08e0221693071894818c7d3bae531b..5980b70e2d7273239245237189b2debc
private static final int NEUTRAL_MOB_DEATH_NOTIFICATION_RADII_Y = 10;
private static final int FLY_STAT_RECORDING_SPEED = 25;
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
-index c38c688417f769a6022dd40d6652b00e14c4df94..43eeb8ce4bc350c2b524ade11ca25d8d4d21bea5 100644
+index 1645a40c8ea0f141474549a6d90554478a538087..f9141e1997ef88ff5478d4a01b6bc719125631f2 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
-@@ -569,6 +569,7 @@ public abstract class PlayerList {
+@@ -568,6 +568,7 @@ public abstract class PlayerList {
protected void save(ServerPlayer player) {
if (!player.getBukkitEntity().isPersistent()) return; // CraftBukkit
@@ -119,7 +119,7 @@ index c38c688417f769a6022dd40d6652b00e14c4df94..43eeb8ce4bc350c2b524ade11ca25d8d
this.playerIo.save(player);
ServerStatsCounter serverstatisticmanager = (ServerStatsCounter) player.getStats(); // CraftBukkit
-@@ -1183,10 +1184,22 @@ public abstract class PlayerList {
+@@ -1182,9 +1183,21 @@ public abstract class PlayerList {
}
public void saveAll() {
@@ -129,7 +129,6 @@ index c38c688417f769a6022dd40d6652b00e14c4df94..43eeb8ce4bc350c2b524ade11ca25d8d
+
+ public void saveAll(int interval) {
io.papermc.paper.util.MCUtil.ensureMain("Save Players" , () -> { // Paper - Ensure main
- MinecraftTimings.savePlayers.startTiming(); // Paper
+ int numSaved = 0;
+ long now = MinecraftServer.currentTick;
for (int i = 0; i < this.players.size(); ++i) {
@@ -141,5 +140,5 @@ index c38c688417f769a6022dd40d6652b00e14c4df94..43eeb8ce4bc350c2b524ade11ca25d8d
+ }
+ // Paper end - Incremental chunk and player saving
}
- MinecraftTimings.savePlayers.stopTiming(); // Paper
return null; }); // Paper - ensure main
+ }