summaryrefslogtreecommitdiffstats
path: root/EssentialsGroupManager/src/org
diff options
context:
space:
mode:
Diffstat (limited to 'EssentialsGroupManager/src/org')
-rw-r--r--EssentialsGroupManager/src/org/anjocaido/groupmanager/GroupManager.java2
-rw-r--r--EssentialsGroupManager/src/org/anjocaido/groupmanager/dataholder/worlds/WorldsHolder.java13
2 files changed, 13 insertions, 2 deletions
diff --git a/EssentialsGroupManager/src/org/anjocaido/groupmanager/GroupManager.java b/EssentialsGroupManager/src/org/anjocaido/groupmanager/GroupManager.java
index 43b764faf..bb61b2145 100644
--- a/EssentialsGroupManager/src/org/anjocaido/groupmanager/GroupManager.java
+++ b/EssentialsGroupManager/src/org/anjocaido/groupmanager/GroupManager.java
@@ -1762,9 +1762,9 @@ public class GroupManager extends JavaPlugin {
dataHolder = worldsHolder.getWorldData(worldsHolder.getDefaultWorld().getName());
permissionHandler = dataHolder.getPermissionsHandler();
- selectedWorlds.put(sender, dataHolder.getName());
if ((dataHolder != null) && (permissionHandler != null)) {
+ selectedWorlds.put(sender, dataHolder.getName());
sender.sendMessage(ChatColor.RED + "Couldn't retrieve your world. Default world '" + worldsHolder.getDefaultWorld().getName() + "' selected.");
return true;
}
diff --git a/EssentialsGroupManager/src/org/anjocaido/groupmanager/dataholder/worlds/WorldsHolder.java b/EssentialsGroupManager/src/org/anjocaido/groupmanager/dataholder/worlds/WorldsHolder.java
index 686a5495d..6d819daa5 100644
--- a/EssentialsGroupManager/src/org/anjocaido/groupmanager/dataholder/worlds/WorldsHolder.java
+++ b/EssentialsGroupManager/src/org/anjocaido/groupmanager/dataholder/worlds/WorldsHolder.java
@@ -320,7 +320,8 @@ public class WorldsHolder {
* If the world is not on the worlds list, returns the default world
* holder.
*
- * Mirrors return original world data.
+ * Mirrors return their parent world data.
+ * If no mirroring data it returns the default world.
*
* @param worldName
* @return OverloadedWorldHolder
@@ -328,8 +329,17 @@ public class WorldsHolder {
public OverloadedWorldHolder getWorldData(String worldName) {
String worldNameLowered = worldName.toLowerCase();
+ // Return this worlds data
if (worldsData.containsKey(worldNameLowered))
return worldsData.get(worldNameLowered);
+
+ // If groups mirrored return the parent worlds data
+ if (mirrorsGroup.containsKey(worldNameLowered))
+ return worldsData.get(mirrorsGroup.get(worldNameLowered).toLowerCase());
+
+ // If users mirrored return the parent worlds data
+ if (mirrorsUser.containsKey(worldNameLowered))
+ return worldsData.get(mirrorsUser.get(worldNameLowered).toLowerCase());
GroupManager.logger.finest("Requested world " + worldName + " not found or badly mirrored. Returning default world...");
return getDefaultWorld();
@@ -353,6 +363,7 @@ public class WorldsHolder {
/**
* Retrieves the field player.getWorld().getName() and do
* getWorld(worldName)
+ *
* @param player
* @return OverloadedWorldHolder
*/