From 42dfd206a6f25e7098254b830a50438f78e54470 Mon Sep 17 00:00:00 2001 From: CraftBukkit/Spigot Date: Sat, 18 Aug 2012 17:36:39 -0500 Subject: [PATCH] [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. By: Mike Primm --- .../src/main/java/org/bukkit/craftbukkit/CraftServer.java | 2 ++ paper-server/src/main/resources/configurations/bukkit.yml | 1 + 2 files changed, 3 insertions(+) diff --git a/paper-server/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/paper-server/src/main/java/org/bukkit/craftbukkit/CraftServer.java index b024f5443..0c55945b2 100644 --- a/paper-server/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/paper-server/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/paper-server/src/main/resources/configurations/bukkit.yml b/paper-server/src/main/resources/configurations/bukkit.yml index 486dbbc75..b34d84f0a 100644 --- a/paper-server/src/main/resources/configurations/bukkit.yml +++ b/paper-server/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]