summaryrefslogtreecommitdiffstats
path: root/src/main/java/net
diff options
context:
space:
mode:
authorMike Primm <mike@primmhome.com>2012-08-18 17:36:39 -0500
committerEvilSeph <evilseph@gmail.com>2012-09-12 22:05:52 -0400
commitbeee3ce2dab695e83cf4f66bb055e504dc36ada7 (patch)
treed3be0e4d37b68e9f5bb0e2f8bd5fdb1625ea84ea /src/main/java/net
parente2b1514daf678d8ea95a71af8bbb2a9b8efb3440 (diff)
downloadcraftbukkit-beee3ce2dab695e83cf4f66bb055e504dc36ada7.tar
craftbukkit-beee3ce2dab695e83cf4f66bb055e504dc36ada7.tar.gz
craftbukkit-beee3ce2dab695e83cf4f66bb055e504dc36ada7.tar.lz
craftbukkit-beee3ce2dab695e83cf4f66bb055e504dc36ada7.tar.xz
craftbukkit-beee3ce2dab695e83cf4f66bb055e504dc36ada7.zip
[Bleeding] Add autosave interval setting in bukkit.yml. Adds BUKKIT-2507
The new setting is located at "ticks-per.autosave". By changing this value, it affects how often a full save is automatically executed, measured in ticks. This value is defaulting to 0 (off) because we believe that the vast majority of servers already have a third-party solution to automatically saving the server at set intervals. Having the built in auto-save disabled by default ensures that we are not saving things twice; doing so leads to absolutely no benefits, but results in detrimental and noticeable unnecessary performance decrease. For servers that do not use an automated external script to perform saves, this setting can be turned on by setting the value higher than 0, with 900 being the value used in vanilla.
Diffstat (limited to 'src/main/java/net')
-rw-r--r--src/main/java/net/minecraft/server/MinecraftServer.java3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index 7ee37487..655a8320 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -80,6 +80,7 @@ public abstract class MinecraftServer implements Runnable, IMojangStatistics, IC
public static int currentTick;
public final Thread primaryThread;
public java.util.Queue<PlayerChatEvent> chatQueue = new java.util.concurrent.ConcurrentLinkedQueue<PlayerChatEvent>();
+ public int autosavePeriod;
// CraftBukkit end
public MinecraftServer(OptionSet options) { // CraftBukkit - signature file -> OptionSet
@@ -472,7 +473,7 @@ public abstract class MinecraftServer implements Runnable, IMojangStatistics, IC
this.methodProfiler.a("root");
this.q();
- if (this.ticks % 900 == 0) {
+ if ((this.autosavePeriod > 0) && ((this.ticks % this.autosavePeriod) == 0)) { // CraftBukkit
this.methodProfiler.a("save");
this.t.savePlayers();
this.saveChunks(true);