Don't save players every tick, oops

This commit is contained in:
Aikar 2016-09-19 23:39:21 -04:00
parent f18f712da2
commit 7c6d0644a2

View file

@ -43,7 +43,11 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ if (autosavePeriod > 0 /*&& this.ticks % autosavePeriod == 0*/) { // CraftBukkit // Paper - Incremental Auto Saving
MinecraftTimings.worldSaveTimer.startTiming(); // Spigot
this.methodProfiler.a("save");
this.v.savePlayers();
- this.v.savePlayers();
+ if (this.ticks % autosavePeriod == 0) this.v.savePlayers(); // Paper - Incremental Auto Saving
// Spigot Start
// We replace this with saving each individual world as this.saveChunks(...) is broken,
// and causes the main thread to sleep for random amounts of time depending on chunk activity
diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/server/WorldServer.java