Sfoglia il codice sorgente

Added config option to disable automatic zip backups

GJ 12 anni fa
parent
commit
11bd473f55

+ 1 - 0
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

+ 1 - 0
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); }
 

+ 8 - 6
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!

+ 2 - 0
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: