diff options
author | ElgarL <ElgarL@palmergames.com> | 2012-02-02 02:01:04 +0000 |
---|---|---|
committer | ElgarL <ElgarL@palmergames.com> | 2012-02-02 02:01:04 +0000 |
commit | dbf30740fb95fdacc2d3f21faa2b1c54e2e28777 (patch) | |
tree | d5d5d6af8354e284cbe7e2384967f1a48b291fce /EssentialsGroupManager/src/org/anjocaido | |
parent | 3f02bcd702f890d1ccba35e2217b61d730ff9953 (diff) | |
download | Essentials-dbf30740fb95fdacc2d3f21faa2b1c54e2e28777.tar Essentials-dbf30740fb95fdacc2d3f21faa2b1c54e2e28777.tar.gz Essentials-dbf30740fb95fdacc2d3f21faa2b1c54e2e28777.tar.lz Essentials-dbf30740fb95fdacc2d3f21faa2b1c54e2e28777.tar.xz Essentials-dbf30740fb95fdacc2d3f21faa2b1c54e2e28777.zip |
Fix a bug with getWorldData return the main world data for all mirrors,
instead of the worlds parent data.
Diffstat (limited to 'EssentialsGroupManager/src/org/anjocaido')
-rw-r--r-- | EssentialsGroupManager/src/org/anjocaido/groupmanager/GroupManager.java | 2 | ||||
-rw-r--r-- | EssentialsGroupManager/src/org/anjocaido/groupmanager/dataholder/worlds/WorldsHolder.java | 13 |
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 */ |