summaryrefslogtreecommitdiffstats
path: root/EssentialsGroupManager
diff options
context:
space:
mode:
authorElgarL <ElgarL@palmergames.com>2013-02-22 11:46:59 +0000
committerElgarL <ElgarL@palmergames.com>2013-02-22 11:46:59 +0000
commit78c4ca51820e46564d45f07cbc6049096536e076 (patch)
tree02beffd21cb4fd7ed3d9263a9d0afeed562fb4dc /EssentialsGroupManager
parent696aff7c196b9dfa660a4b39b491052d1264155a (diff)
downloadEssentials-78c4ca51820e46564d45f07cbc6049096536e076.tar
Essentials-78c4ca51820e46564d45f07cbc6049096536e076.tar.gz
Essentials-78c4ca51820e46564d45f07cbc6049096536e076.tar.lz
Essentials-78c4ca51820e46564d45f07cbc6049096536e076.tar.xz
Essentials-78c4ca51820e46564d45f07cbc6049096536e076.zip
'/manselect' will no longer list duplicate worlds.
Diffstat (limited to 'EssentialsGroupManager')
-rw-r--r--EssentialsGroupManager/src/Changelog.txt3
-rw-r--r--EssentialsGroupManager/src/org/anjocaido/groupmanager/dataholder/worlds/WorldsHolder.java21
2 files changed, 17 insertions, 7 deletions
diff --git a/EssentialsGroupManager/src/Changelog.txt b/EssentialsGroupManager/src/Changelog.txt
index be9ec8abd..044bd62d3 100644
--- a/EssentialsGroupManager/src/Changelog.txt
+++ b/EssentialsGroupManager/src/Changelog.txt
@@ -213,4 +213,5 @@ v 2.0:
- Prevent '*' permissions granting the 'groupmanager.noofflineperms' permission.
- Added '/mancheckw <world>' to inspect which permission files a world is referencing.
- Add config potion to set if GM commands should be allowed on CommnandBlocks.
- - Catch the error when using an out of date config for 'allow_commandblocks' So it doesn't kill the whole config. \ No newline at end of file
+ - Catch the error when using an out of date config for 'allow_commandblocks' So it doesn't kill the whole config.
+ - '/manselect' will no longer list duplicate worlds. \ No newline at end of file
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