summaryrefslogtreecommitdiffstats
path: root/src/main
diff options
context:
space:
mode:
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/net/minecraft/server/MinecraftServer.java3
-rw-r--r--src/main/java/org/bukkit/craftbukkit/CraftServer.java2
-rw-r--r--src/main/resources/configurations/bukkit.yml1
3 files changed, 5 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);
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index b024f544..0c55945b 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -186,6 +186,7 @@ public final class CraftServer implements Server {
monsterSpawn = configuration.getInt("spawn-limits.monsters");
animalSpawn = configuration.getInt("spawn-limits.animals");
waterAnimalSpawn = configuration.getInt("spawn-limits.water-animals");
+ console.autosavePeriod = configuration.getInt("ticks-per.autosave");
warningState = WarningState.value(configuration.getString("settings.deprecated-verbose"));
updater = new AutoUpdater(new BukkitDLUpdaterService(configuration.getString("auto-updater.host")), getLogger(), configuration.getString("auto-updater.preferred-channel"));
@@ -522,6 +523,7 @@ public final class CraftServer implements Server {
animalSpawn = configuration.getInt("spawn-limits.animals");
waterAnimalSpawn = configuration.getInt("spawn-limits.water-animals");
warningState = WarningState.value(configuration.getString("settings.deprecated-verbose"));
+ console.autosavePeriod = configuration.getInt("ticks-per.autosave");
for (WorldServer world : console.worlds) {
world.difficulty = difficulty;
diff --git a/src/main/resources/configurations/bukkit.yml b/src/main/resources/configurations/bukkit.yml
index 486dbbc7..b34d84f0 100644
--- a/src/main/resources/configurations/bukkit.yml
+++ b/src/main/resources/configurations/bukkit.yml
@@ -32,6 +32,7 @@ spawn-limits:
ticks-per:
animal-spawns: 400
monster-spawns: 1
+ autosave: 0
auto-updater:
enabled: true
on-broken: [warn-console, warn-ops]