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 | |
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.
3 files changed, 15 insertions, 3 deletions
diff --git a/EssentialsGroupManager/src/Changelog.txt b/EssentialsGroupManager/src/Changelog.txt index 490df8fc6..e48365de5 100644 --- a/EssentialsGroupManager/src/Changelog.txt +++ b/EssentialsGroupManager/src/Changelog.txt @@ -133,4 +133,5 @@ v 1.9: - -vanish.*
- vanish.standard
- Track the 'onPlayerChangeWorld' event as some teleports seem to not be triggering a world move.
- - Catch all errors in badly formatted groups.
\ No newline at end of file + - Catch all errors in badly formatted groups.
+ - Fix a bug with getWorldData return the main world data for all mirrors, instead of the worlds parent data.
\ No newline at end of file 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 */ |