diff options
author | ElgarL <ElgarL@palmergames.com> | 2013-02-22 11:46:59 +0000 |
---|---|---|
committer | ElgarL <ElgarL@palmergames.com> | 2013-02-22 11:46:59 +0000 |
commit | 13e07f64ecae02f002ac5a94ab7b39a2b4059718 (patch) | |
tree | 9aee1530b390e567e85243d9f45248ee1a86fbb4 /EssentialsGroupManager/src/org | |
parent | 7f972801bf1986d1a48b70a097cef8c1711b2c67 (diff) | |
download | Essentials-13e07f64ecae02f002ac5a94ab7b39a2b4059718.tar Essentials-13e07f64ecae02f002ac5a94ab7b39a2b4059718.tar.gz Essentials-13e07f64ecae02f002ac5a94ab7b39a2b4059718.tar.lz Essentials-13e07f64ecae02f002ac5a94ab7b39a2b4059718.tar.xz Essentials-13e07f64ecae02f002ac5a94ab7b39a2b4059718.zip |
'/manselect' will no longer list duplicate worlds.
Diffstat (limited to 'EssentialsGroupManager/src/org')
-rw-r--r-- | EssentialsGroupManager/src/org/anjocaido/groupmanager/dataholder/worlds/WorldsHolder.java | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/EssentialsGroupManager/src/org/anjocaido/groupmanager/dataholder/worlds/WorldsHolder.java b/EssentialsGroupManager/src/org/anjocaido/groupmanager/dataholder/worlds/WorldsHolder.java index 2661c6bc0..9accfaf95 100644 --- a/EssentialsGroupManager/src/org/anjocaido/groupmanager/dataholder/worlds/WorldsHolder.java +++ b/EssentialsGroupManager/src/org/anjocaido/groupmanager/dataholder/worlds/WorldsHolder.java @@ -699,16 +699,21 @@ public class WorldsHolder { } /** - * Returns all physically loaded worlds which have at least - * one of their own data sets for users or groups which isn't an identical mirror. + * Returns all physically loaded worlds which have at least one of their own + * data sets for users or groups which isn't an identical mirror. * * @return ArrayList<OverloadedWorldHolder> of all loaded worlds */ public ArrayList<OverloadedWorldHolder> allWorldsDataList() { ArrayList<OverloadedWorldHolder> list = new ArrayList<OverloadedWorldHolder>(); - for (OverloadedWorldHolder data : worldsData.values()) { - if ((!list.contains(data))) { // && (!mirrorsGroup.containsKey(data.getName().toLowerCase()) || !mirrorsUser.containsKey(data.getName().toLowerCase()))) { + + for (String world : worldsData.keySet()) { + + // Fetch the relevant world object + OverloadedWorldHolder data = getWorldData(world); + + if (!list.contains(data)) { String worldNameLowered = data.getName().toLowerCase(); String usersMirror = mirrorsUser.get(worldNameLowered); @@ -722,8 +727,12 @@ public class WorldsHolder { // if the data sources are the same, return the parent if (usersMirror == groupsMirror) { - if (!list.contains(usersMirror.toLowerCase())) - list.add(worldsData.get(usersMirror.toLowerCase())); + data = getWorldData(usersMirror.toLowerCase()); + + // Only add the parent if it's not already listed. + if (!list.contains(data)) + list.add(data); + continue; } // Both data sources are mirrors, but they are from different parents |