mirror of
https://github.com/TotalFreedomMC/TF-EssentialsX.git
synced 2024-08-20 18:32:49 +00:00
Only output a Data update message if something has changed.
This commit is contained in:
parent
5683ea35fc
commit
656f25dc97
|
@ -183,4 +183,5 @@ v 2.0:
|
|||
- Re-initialize the WorldsHolder on a reload, as un-registering and re-registering a new holder means all plugins have to check for the new service on every quiery.
|
||||
- Prevent null perms getting past the GlobalGroups loader.
|
||||
- Fix forgetting sub groups on a manload.
|
||||
- Allow 'manucheckp' to notify when superperms reports false but it is really negated.
|
||||
- Allow 'manucheckp' to notify when superperms reports false but it is really negated.
|
||||
- Only output a Data update message if something has changed.
|
|
@ -324,8 +324,8 @@ public class GroupManager extends JavaPlugin {
|
|||
public void run() {
|
||||
|
||||
try {
|
||||
worldsHolder.saveChanges(false);
|
||||
GroupManager.logger.log(Level.INFO, " Data files refreshed.");
|
||||
if (worldsHolder.saveChanges(false))
|
||||
GroupManager.logger.log(Level.INFO, " Data files refreshed.");
|
||||
} catch (IllegalStateException ex) {
|
||||
GroupManager.logger.log(Level.WARNING, ex.getMessage());
|
||||
}
|
||||
|
|
|
@ -264,8 +264,9 @@ public class WorldsHolder {
|
|||
/**
|
||||
*
|
||||
*/
|
||||
public void saveChanges(boolean overwrite) {
|
||||
public boolean saveChanges(boolean overwrite) {
|
||||
|
||||
boolean changed = false;
|
||||
ArrayList<WorldDataHolder> alreadyDone = new ArrayList<WorldDataHolder>();
|
||||
Tasks.removeOldFiles(plugin, plugin.getBackupFolder());
|
||||
|
||||
|
@ -294,6 +295,7 @@ public class WorldsHolder {
|
|||
backupFile(w, true);
|
||||
|
||||
WorldDataHolder.writeGroups(w, w.getGroupsFile());
|
||||
changed = true;
|
||||
//w.removeGroupsChangedFlag();
|
||||
} else {
|
||||
// Newer file found.
|
||||
|
@ -307,6 +309,7 @@ public class WorldsHolder {
|
|||
// Backup Groups file
|
||||
backupFile(w, true);
|
||||
w.reloadGroups();
|
||||
changed = true;
|
||||
}
|
||||
}
|
||||
if (!mirrorsUser.containsKey(w.getName().toLowerCase()))
|
||||
|
@ -316,6 +319,7 @@ public class WorldsHolder {
|
|||
backupFile(w, false);
|
||||
|
||||
WorldDataHolder.writeUsers(w, w.getUsersFile());
|
||||
changed = true;
|
||||
//w.removeUsersChangedFlag();
|
||||
} else {
|
||||
// Newer file found.
|
||||
|
@ -329,10 +333,12 @@ public class WorldsHolder {
|
|||
// Backup Users file
|
||||
backupFile(w, false);
|
||||
w.reloadUsers();
|
||||
changed = true;
|
||||
}
|
||||
}
|
||||
alreadyDone.add(w);
|
||||
}
|
||||
return changed;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue