diff --git a/Spigot-Server-Patches/Auto-Save-Improvements.patch b/Spigot-Server-Patches/Auto-Save-Improvements.patch index 60ff5a51a1..23d87f872d 100644 --- a/Spigot-Server-Patches/Auto-Save-Improvements.patch +++ b/Spigot-Server-Patches/Auto-Save-Improvements.patch @@ -78,6 +78,14 @@ diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/ index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java +@@ -0,0 +0,0 @@ public abstract class MinecraftServer implements Runnable, ICommandListener, IAs + public final Thread primaryThread; + public java.util.Queue processQueue = new java.util.concurrent.ConcurrentLinkedQueue(); + public int autosavePeriod; ++ public boolean serverAutoSave = false; // Paper + // CraftBukkit end + + public MinecraftServer(OptionSet options, Proxy proxy, DataConverterManager dataconvertermanager, YggdrasilAuthenticationService yggdrasilauthenticationservice, MinecraftSessionService minecraftsessionservice, GameProfileRepository gameprofilerepository, UserCache usercache) { @@ -0,0 +0,0 @@ public abstract class MinecraftServer implements Runnable, ICommandListener, IAs this.q.b().a(agameprofile); } @@ -86,7 +94,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 MinecraftTimings.worldSaveTimer.startTiming(); // Spigot this.methodProfiler.a("save"); + -+ if (autosavePeriod > 0 && this.ticks % autosavePeriod == 0) { // CraftBukkit ++ serverAutoSave = (autosavePeriod > 0 && this.ticks % autosavePeriod == 0); // Paper ++ if (serverAutoSave) { // CraftBukkit // Paper this.v.savePlayers(); // Spigot Start + } // Paper - Incremental Auto Saving @@ -122,4 +131,10 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 if (iprogressupdate != null) { iprogressupdate.a("Saving level"); } + +- this.a(); ++ if (flag || server.serverAutoSave) this.a(); // Paper + if (iprogressupdate != null) { + iprogressupdate.c("Saving chunks"); + } -- \ No newline at end of file