diff options
author | ElgarL <ElgarL@palmergames.com> | 2012-04-10 20:48:34 +0100 |
---|---|---|
committer | ElgarL <ElgarL@palmergames.com> | 2012-04-10 20:48:34 +0100 |
commit | 59cf2716745402cbbb04ccf7be97a144a8d16ae1 (patch) | |
tree | 2e0d30ac96d6c0de3b34f62b71e9cb6d77e7c0ac /EssentialsGroupManager/src/org | |
parent | 41a786b83692e4693e895261129421d5b334fb0a (diff) | |
download | Essentials-59cf2716745402cbbb04ccf7be97a144a8d16ae1.tar Essentials-59cf2716745402cbbb04ccf7be97a144a8d16ae1.tar.gz Essentials-59cf2716745402cbbb04ccf7be97a144a8d16ae1.tar.lz Essentials-59cf2716745402cbbb04ccf7be97a144a8d16ae1.tar.xz Essentials-59cf2716745402cbbb04ccf7be97a144a8d16ae1.zip |
Fix 'manuadd' to use the default or selected world (via 'manselect'), if
the world is not specified in the command.
Diffstat (limited to 'EssentialsGroupManager/src/org')
-rw-r--r-- | EssentialsGroupManager/src/org/anjocaido/groupmanager/GroupManager.java | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/EssentialsGroupManager/src/org/anjocaido/groupmanager/GroupManager.java b/EssentialsGroupManager/src/org/anjocaido/groupmanager/GroupManager.java index b39b640a4..1177e3357 100644 --- a/EssentialsGroupManager/src/org/anjocaido/groupmanager/GroupManager.java +++ b/EssentialsGroupManager/src/org/anjocaido/groupmanager/GroupManager.java @@ -457,9 +457,18 @@ public class GroupManager extends JavaPlugin { sender.sendMessage(ChatColor.RED + "Review your arguments count! (/<command> <player> <group> | optional [world])"); return false; } - // Select the relevant world - dataHolder = worldsHolder.getWorldData((args.length == 3)? args[2]:Bukkit.getWorlds().get(0).getName()); - permissionHandler = dataHolder.getPermissionsHandler(); + + // Select the relevant world (if specified) + if (args.length == 3) { + dataHolder = worldsHolder.getWorldData(args[2]); + permissionHandler = dataHolder.getPermissionsHandler(); + } + + // Validating state of sender + if (dataHolder == null || permissionHandler == null) { + if (!setDefaultWorldHandler(sender)) + return true; + } if ((validateOnlinePlayer) && ((match = validatePlayer(args[0], sender)) == null)) { return false; |