mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-25 22:56:45 +01:00
Added config option to make .new config files instead over writing over old ones when updating
This commit is contained in:
parent
d052d7a3ce
commit
3b07d4055a
@ -36,6 +36,8 @@ Version 1.4.00-dev
|
|||||||
+ Added config option to disable automatic zip backups.
|
+ Added config option to disable automatic zip backups.
|
||||||
+ Added particle effects for many abilities.
|
+ Added particle effects for many abilities.
|
||||||
+ Added '/mcnotify' command to toggle ability notifications on/off
|
+ Added '/mcnotify' command to toggle ability notifications on/off
|
||||||
|
+ Added ability for config files to automatically update with new keys, and prune out old ones
|
||||||
|
+ Added config option to make .new config files instead over writing over old ones when updating
|
||||||
= Fixed Green Thumb on wheat not working properly at rank 4
|
= Fixed Green Thumb on wheat not working properly at rank 4
|
||||||
= Fixed Green Thumb and Green Terra consuming twice the amount of seed needed
|
= Fixed Green Thumb and Green Terra consuming twice the amount of seed needed
|
||||||
= Fixed Green Terra not also checking Green Thumb permissions
|
= Fixed Green Terra not also checking Green Thumb permissions
|
||||||
|
@ -44,6 +44,7 @@ public class Config extends ConfigLoader {
|
|||||||
public boolean getEventCallbackEnabled() { return config.getBoolean("General.Event_Callback", true); }
|
public boolean getEventCallbackEnabled() { return config.getBoolean("General.Event_Callback", true); }
|
||||||
public boolean getBackupsEnabled() { return config.getBoolean("General.Generate_Backups", true); }
|
public boolean getBackupsEnabled() { return config.getBoolean("General.Generate_Backups", true); }
|
||||||
public boolean getVerboseLoggingEnabled() { return config.getBoolean("General.Verbose_Logging", false); }
|
public boolean getVerboseLoggingEnabled() { return config.getBoolean("General.Verbose_Logging", false); }
|
||||||
|
public boolean getConfigOverwriteEnabled() { return config.getBoolean("General.Config_Update_Overwrite", true); }
|
||||||
public boolean getPartyDisplayNames() { return config.getBoolean("Commands.p.Use_Display_Names", 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); }
|
public boolean getAdminDisplayNames() { return config.getBoolean("Commands.a.Use_Display_Names", true); }
|
||||||
|
|
||||||
|
@ -121,7 +121,13 @@ public abstract class ConfigLoader {
|
|||||||
|
|
||||||
// Save it
|
// Save it
|
||||||
try {
|
try {
|
||||||
BufferedWriter writer = new BufferedWriter(new FileWriter(new File(plugin.getDataFolder(), fileName)));
|
String saveName = fileName;
|
||||||
|
// At this stage we cannot guarantee that Config has been loaded, so we do the check directly here
|
||||||
|
if (!plugin.getConfig().getBoolean("General.Config_Update_Overwrite", true)) {
|
||||||
|
saveName += ".new";
|
||||||
|
}
|
||||||
|
|
||||||
|
BufferedWriter writer = new BufferedWriter(new FileWriter(new File(plugin.getDataFolder(), saveName)));
|
||||||
writer.write(output);
|
writer.write(output);
|
||||||
writer.flush();
|
writer.flush();
|
||||||
writer.close();
|
writer.close();
|
||||||
|
@ -24,6 +24,8 @@ General:
|
|||||||
Power_Level_Cap: 0
|
Power_Level_Cap: 0
|
||||||
#Should mcMMO print out debug messages?
|
#Should mcMMO print out debug messages?
|
||||||
Verbose_Logging: false
|
Verbose_Logging: false
|
||||||
|
#Should mcMMO over-write configs to update, or make new ones ending in .new?
|
||||||
|
Config_Update_Overwrite: true
|
||||||
|
|
||||||
Database_Purging:
|
Database_Purging:
|
||||||
#Amount of time (in hours) to wait between database purging
|
#Amount of time (in hours) to wait between database purging
|
||||||
|
Loading…
Reference in New Issue
Block a user