From 3725f9d940f2284176132511819622751d3a73f9 Mon Sep 17 00:00:00 2001 From: Aikar Date: Fri, 4 Nov 2016 01:31:49 -0400 Subject: [PATCH] Fix faulty logic in Auto Save check - Fixes #443 --- .../0169-Auto-Save-Improvements.patch | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/Spigot-Server-Patches/0169-Auto-Save-Improvements.patch b/Spigot-Server-Patches/0169-Auto-Save-Improvements.patch index 9c3d021b82..5d122620cc 100644 --- a/Spigot-Server-Patches/0169-Auto-Save-Improvements.patch +++ b/Spigot-Server-Patches/0169-Auto-Save-Improvements.patch @@ -1,4 +1,4 @@ -From 11a88b05460b3817a48f74e5326416ef447b9eb2 Mon Sep 17 00:00:00 2001 +From 62796acb6d14f2865b036decbdef62089e4870a1 Mon Sep 17 00:00:00 2001 From: Aikar Date: Mon, 19 Sep 2016 23:16:39 -0400 Subject: [PATCH] Auto Save Improvements @@ -42,18 +42,23 @@ index fb67306..eacb1f6 100644 + } } diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java -index 683a6dd..547628a 100644 +index 683a6dd..2314ce0 100644 --- a/src/main/java/net/minecraft/server/Chunk.java +++ b/src/main/java/net/minecraft/server/Chunk.java -@@ -960,7 +960,7 @@ public class Chunk { +@@ -960,11 +960,9 @@ public class Chunk { if (this.t && this.world.getTime() != this.lastSaved || this.s) { return true; } - } else if (this.t && this.world.getTime() >= this.lastSaved + MinecraftServer.getServer().autosavePeriod * 4) { // Spigot - Only save if we've passed 2 auto save intervals without modification -+ } else if (this.t && this.world.getTime() >= this.lastSaved + world.paperConfig.autoSavePeriod) { // Spigot // Paper - Make world configurable and incremental - return true; +- return true; } +- +- return this.s; ++ // This !flag section should say if s(isModified) or t(hasEntities), then check auto save ++ return ((this.s || this.t) && this.world.getTime() >= this.lastSaved + world.paperConfig.autoSavePeriod); // Paper - Make world configurable and incremental + } + public Random a(long i) { diff --git a/src/main/java/net/minecraft/server/ChunkProviderServer.java b/src/main/java/net/minecraft/server/ChunkProviderServer.java index 3828da7..7e53fee 100644 --- a/src/main/java/net/minecraft/server/ChunkProviderServer.java @@ -140,5 +145,5 @@ index fc33575..81712ff 100644 timings.worldSaveChunks.startTiming(); // Paper chunkproviderserver.a(flag); -- -2.9.3 +2.10.2