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.
|
- 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.
|
- Prevent null perms getting past the GlobalGroups loader.
|
||||||
- Fix forgetting sub groups on a manload.
|
- 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() {
|
public void run() {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
worldsHolder.saveChanges(false);
|
if (worldsHolder.saveChanges(false))
|
||||||
GroupManager.logger.log(Level.INFO, " Data files refreshed.");
|
GroupManager.logger.log(Level.INFO, " Data files refreshed.");
|
||||||
} catch (IllegalStateException ex) {
|
} catch (IllegalStateException ex) {
|
||||||
GroupManager.logger.log(Level.WARNING, ex.getMessage());
|
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>();
|
ArrayList<WorldDataHolder> alreadyDone = new ArrayList<WorldDataHolder>();
|
||||||
Tasks.removeOldFiles(plugin, plugin.getBackupFolder());
|
Tasks.removeOldFiles(plugin, plugin.getBackupFolder());
|
||||||
|
|
||||||
|
@ -294,6 +295,7 @@ public class WorldsHolder {
|
||||||
backupFile(w, true);
|
backupFile(w, true);
|
||||||
|
|
||||||
WorldDataHolder.writeGroups(w, w.getGroupsFile());
|
WorldDataHolder.writeGroups(w, w.getGroupsFile());
|
||||||
|
changed = true;
|
||||||
//w.removeGroupsChangedFlag();
|
//w.removeGroupsChangedFlag();
|
||||||
} else {
|
} else {
|
||||||
// Newer file found.
|
// Newer file found.
|
||||||
|
@ -307,6 +309,7 @@ public class WorldsHolder {
|
||||||
// Backup Groups file
|
// Backup Groups file
|
||||||
backupFile(w, true);
|
backupFile(w, true);
|
||||||
w.reloadGroups();
|
w.reloadGroups();
|
||||||
|
changed = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!mirrorsUser.containsKey(w.getName().toLowerCase()))
|
if (!mirrorsUser.containsKey(w.getName().toLowerCase()))
|
||||||
|
@ -316,6 +319,7 @@ public class WorldsHolder {
|
||||||
backupFile(w, false);
|
backupFile(w, false);
|
||||||
|
|
||||||
WorldDataHolder.writeUsers(w, w.getUsersFile());
|
WorldDataHolder.writeUsers(w, w.getUsersFile());
|
||||||
|
changed = true;
|
||||||
//w.removeUsersChangedFlag();
|
//w.removeUsersChangedFlag();
|
||||||
} else {
|
} else {
|
||||||
// Newer file found.
|
// Newer file found.
|
||||||
|
@ -329,10 +333,12 @@ public class WorldsHolder {
|
||||||
// Backup Users file
|
// Backup Users file
|
||||||
backupFile(w, false);
|
backupFile(w, false);
|
||||||
w.reloadUsers();
|
w.reloadUsers();
|
||||||
|
changed = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
alreadyDone.add(w);
|
alreadyDone.add(w);
|
||||||
}
|
}
|
||||||
|
return changed;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in a new issue