diff --git a/resources/config.yml b/resources/config.yml index e168a7f..7c3f801 100644 --- a/resources/config.yml +++ b/resources/config.yml @@ -1,5 +1,6 @@ maxGateBlocks: 50 playerGateBlockUpdateRadius: 64 +saveOnChanges: true checkForBrokenGateFrames: true gateTeleportMessage: "Thank you for traveling with Craft Inc. Gates." showTeleportMessage: true diff --git a/src/de/craftinc/gates/Gate.java b/src/de/craftinc/gates/Gate.java index 6739e54..2fd860e 100644 --- a/src/de/craftinc/gates/Gate.java +++ b/src/de/craftinc/gates/Gate.java @@ -53,7 +53,7 @@ public class Gate implements ConfigurationSerializable { return super.toString() + " " + this.getId(); } - + /** * diff --git a/src/de/craftinc/gates/Plugin.java b/src/de/craftinc/gates/Plugin.java index a40cc1b..54e657e 100644 --- a/src/de/craftinc/gates/Plugin.java +++ b/src/de/craftinc/gates/Plugin.java @@ -48,6 +48,7 @@ public class Plugin extends JavaPlugin public static final String confShowTeleportMessageKey = "showTeleportMessage"; public static final String confGateTeleportNoPermissionMessageKey = "gateTeleportNoPermissionMessage"; public static final String confShowTeleportNoPermissionMessageKey = "showTeleportNoPermissionMessage"; + public static final String confSaveOnChangesKey = "saveOnChanges"; private static Plugin instance; private static Permission permission; @@ -151,7 +152,6 @@ public class Plugin extends JavaPlugin if (success) { log("Enabled"); - } else { PluginManager pm = this.getServer().getPluginManager(); diff --git a/src/de/craftinc/gates/commands/BaseCommand.java b/src/de/craftinc/gates/commands/BaseCommand.java index a1fca24..b29e53d 100644 --- a/src/de/craftinc/gates/commands/BaseCommand.java +++ b/src/de/craftinc/gates/commands/BaseCommand.java @@ -69,7 +69,7 @@ public abstract class BaseCommand this.perform(); - if (this.shouldPersistToDisk) { + if (this.shouldPersistToDisk && Plugin.getPlugin().getConfig().getBoolean(Plugin.confSaveOnChangesKey)) { Plugin.getPlugin().getGatesManager().saveGatesToDisk(); } }