Fix incremental player saving patch

This commit is contained in:
Nassim Jahnke 2023-05-27 20:14:04 +02:00
parent bcd8dc2c11
commit 90a0835f43
No known key found for this signature in database
GPG Key ID: 6BE3B555EBC5982B

View File

@ -127,7 +127,7 @@ index 2c052d0a8c6d58ad8eae41c22c753327342e90f1..5b6ecebcb4585877a2761eb17f481004
private static final int NEUTRAL_MOB_DEATH_NOTIFICATION_RADII_Y = 10; private static final int NEUTRAL_MOB_DEATH_NOTIFICATION_RADII_Y = 10;
public ServerGamePacketListenerImpl connection; public ServerGamePacketListenerImpl connection;
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
index 0e2a84148e721a8f799f0746e379c16a5f7f0dd3..44ead3a9831d913f7337a447b73a94e06fb0f06a 100644 index 0e2a84148e721a8f799f0746e379c16a5f7f0dd3..9fefab398072721e3b0aebea0146d82f9046c203 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java --- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -528,6 +528,7 @@ public abstract class PlayerList { @@ -528,6 +528,7 @@ public abstract class PlayerList {
@ -156,7 +156,7 @@ index 0e2a84148e721a8f799f0746e379c16a5f7f0dd3..44ead3a9831d913f7337a447b73a94e0
+ ServerPlayer entityplayer = this.players.get(i); + ServerPlayer entityplayer = this.players.get(i);
+ if (interval == -1 || now - entityplayer.lastSave >= interval) { + if (interval == -1 || now - entityplayer.lastSave >= interval) {
+ this.save(entityplayer); + this.save(entityplayer);
+ if (interval != -1 && ++numSaved <= io.papermc.paper.configuration.GlobalConfiguration.get().playerAutoSave.maxPerTick()) { break; } + if (interval != -1 && io.papermc.paper.configuration.GlobalConfiguration.get().playerAutoSave.maxPerTick() != -1 && ++numSaved >= io.papermc.paper.configuration.GlobalConfiguration.get().playerAutoSave.maxPerTick()) { break; }
+ } + }
+ // Paper end + // Paper end
} }