summaryrefslogtreecommitdiffstats
path: root/EssentialsGroupManager/src/org
diff options
context:
space:
mode:
authorElgarL <ElgarL@palmergames.com>2012-06-22 15:44:04 +0100
committerElgarL <ElgarL@palmergames.com>2012-06-22 15:44:04 +0100
commita45f9f550287cbbe063b6b46e8aac0001fc3c9f9 (patch)
tree1d5861a80765f3af95a55ba8bd4d9386513e5c8f /EssentialsGroupManager/src/org
parentf8d63373645ef36f41f9fd9de29a7d717c0fc6a5 (diff)
downloadEssentials-a45f9f550287cbbe063b6b46e8aac0001fc3c9f9.tar
Essentials-a45f9f550287cbbe063b6b46e8aac0001fc3c9f9.tar.gz
Essentials-a45f9f550287cbbe063b6b46e8aac0001fc3c9f9.tar.lz
Essentials-a45f9f550287cbbe063b6b46e8aac0001fc3c9f9.tar.xz
Essentials-a45f9f550287cbbe063b6b46e8aac0001fc3c9f9.zip
Only output a Data update message if something has changed.
Diffstat (limited to 'EssentialsGroupManager/src/org')
-rw-r--r--EssentialsGroupManager/src/org/anjocaido/groupmanager/GroupManager.java4
-rw-r--r--EssentialsGroupManager/src/org/anjocaido/groupmanager/dataholder/worlds/WorldsHolder.java8
2 files changed, 9 insertions, 3 deletions
diff --git a/EssentialsGroupManager/src/org/anjocaido/groupmanager/GroupManager.java b/EssentialsGroupManager/src/org/anjocaido/groupmanager/GroupManager.java
index 5f357641a..61bb41dd1 100644
--- a/EssentialsGroupManager/src/org/anjocaido/groupmanager/GroupManager.java
+++ b/EssentialsGroupManager/src/org/anjocaido/groupmanager/GroupManager.java
@@ -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());
}
diff --git a/EssentialsGroupManager/src/org/anjocaido/groupmanager/dataholder/worlds/WorldsHolder.java b/EssentialsGroupManager/src/org/anjocaido/groupmanager/dataholder/worlds/WorldsHolder.java
index 27a7d9a59..f9735c282 100644
--- a/EssentialsGroupManager/src/org/anjocaido/groupmanager/dataholder/worlds/WorldsHolder.java
+++ b/EssentialsGroupManager/src/org/anjocaido/groupmanager/dataholder/worlds/WorldsHolder.java
@@ -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;
}
/**