From 11bd473f557b26b905843e9e4d34c7f8c4935be7 Mon Sep 17 00:00:00 2001 From: GJ Date: Fri, 15 Feb 2013 07:50:32 -0500 Subject: [PATCH] Added config option to disable automatic zip backups --- Changelog.txt | 1 + src/main/java/com/gmail/nossr50/config/Config.java | 1 + src/main/java/com/gmail/nossr50/mcMMO.java | 14 ++++++++------ src/main/resources/config.yml | 2 ++ 4 files changed, 12 insertions(+), 6 deletions(-) diff --git a/Changelog.txt b/Changelog.txt index 6dcd977d0..e23518021 100644 --- a/Changelog.txt +++ b/Changelog.txt @@ -32,6 +32,7 @@ Version 1.4.00-dev + Added "Chinese (Taiwan)" localization files (zh_TW) + Added '/hardcore' and '/vampirism' commands for toggling these modes on or off. + Added Block Cracker to Unarmed's Berserk, turn smooth brick into cracked smooth brick + + Added config option to disable automatic zip backups. = Fixed Green Terra not also checking Green Thumb permissions = Fixed bug where splash potions could raise a player's unarmed level = Fixed bug where fired arrows could raise skill levels other than Archery diff --git a/src/main/java/com/gmail/nossr50/config/Config.java b/src/main/java/com/gmail/nossr50/config/Config.java index 6a930f935..f978c477f 100644 --- a/src/main/java/com/gmail/nossr50/config/Config.java +++ b/src/main/java/com/gmail/nossr50/config/Config.java @@ -36,6 +36,7 @@ public class Config extends ConfigLoader { public int getSaveInterval() { return config.getInt("General.Save_Interval", 10); } public boolean getStatsTrackingEnabled() { return config.getBoolean("General.Stats_Tracking", true); } public boolean getEventCallbackEnabled() { return config.getBoolean("General.Event_Callback", true); } + public boolean getBackupsEnabled() { return config.getBoolean("General.Generate_Backups", true); } public boolean getPartyDisplayNames() { return config.getBoolean("Commands.p.Use_Display_Names", true); } public boolean getAdminDisplayNames() { return config.getBoolean("Commands.a.Use_Display_Names", true); } diff --git a/src/main/java/com/gmail/nossr50/mcMMO.java b/src/main/java/com/gmail/nossr50/mcMMO.java index f9773d7a4..78ea3505b 100644 --- a/src/main/java/com/gmail/nossr50/mcMMO.java +++ b/src/main/java/com/gmail/nossr50/mcMMO.java @@ -186,12 +186,14 @@ public class mcMMO extends JavaPlugin { placeStore.saveAll(); // Save our metadata placeStore.cleanUp(); // Cleanup empty metadata stores - // Remove other tasks BEFORE starting the Backup, or we just cancel it straight away. - try { - ZipLibrary.mcMMObackup(); - } - catch (IOException e) { - getLogger().severe(e.toString()); + if (Config.getInstance().getBackupsEnabled()) { + // Remove other tasks BEFORE starting the Backup, or we just cancel it straight away. + try { + ZipLibrary.mcMMObackup(); + } + catch (IOException e) { + getLogger().severe(e.toString()); + } } getLogger().info("Was disabled."); //How informative! diff --git a/src/main/resources/config.yml b/src/main/resources/config.yml index cd2e40d34..e197b2d09 100644 --- a/src/main/resources/config.yml +++ b/src/main/resources/config.yml @@ -16,6 +16,8 @@ General: Stats_Tracking: true #Allow mcMMO to inform other plugins of damage being dealt Event_Callback: true + #Allow mcMMO to create zip backups for flatfile data on shutdown. + Generate_Backups: true Power_Level_Cap: 0 Database_Purging: