1
0
mirror of https://github.com/essentials/Essentials.git synced 2025-08-12 17:45:08 +02:00

Do not list "all_unnamed_worlds" as a selectable world.

This commit is contained in:
ElgarL
2013-02-22 13:17:58 +00:00
parent 6b8196c0cb
commit 48d4f047fb

View File

@@ -745,39 +745,42 @@ public class WorldsHolder {
for (String world : worldsData.keySet()) { for (String world : worldsData.keySet()) {
// Fetch the relevant world object if (!world.equalsIgnoreCase("all_unnamed_worlds")) {
OverloadedWorldHolder data = getWorldData(world);
if (!list.contains(data)) { // Fetch the relevant world object
OverloadedWorldHolder data = getWorldData(world);
String worldNameLowered = data.getName().toLowerCase(); if (!list.contains(data)) {
String usersMirror = mirrorsUser.get(worldNameLowered);
String groupsMirror = mirrorsGroup.get(worldNameLowered);
// is users mirrored? String worldNameLowered = data.getName().toLowerCase();
if (usersMirror != null) { String usersMirror = mirrorsUser.get(worldNameLowered);
String groupsMirror = mirrorsGroup.get(worldNameLowered);
// If both are mirrored // is users mirrored?
if (groupsMirror != null) { if (usersMirror != null) {
// if the data sources are the same, return the parent // If both are mirrored
if (usersMirror == groupsMirror) { if (groupsMirror != null) {
data = getWorldData(usersMirror.toLowerCase());
// Only add the parent if it's not already listed. // if the data sources are the same, return the parent
if (!list.contains(data)) if (usersMirror == groupsMirror) {
list.add(data); data = getWorldData(usersMirror.toLowerCase());
continue; // 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
// so fall through to add the actual data object.
} }
// Both data sources are mirrors, but they are from different parents // Groups isn't a mirror so fall through to add this this worlds data source
// so fall through to add the actual data object.
} }
// Groups isn't a mirror so fall through to add this this worlds data source
}
// users isn't mirrored so we need to add this worlds data source // users isn't mirrored so we need to add this worlds data source
list.add(data); list.add(data);
}
} }
} }
return list; return list;