Fix 'manuadd' to use the default or selected world (via 'manselect'), if

the world is not specified in the command.
This commit is contained in:
ElgarL 2012-04-10 20:48:34 +01:00
parent cdae0898c7
commit cd24ffbada
2 changed files with 14 additions and 4 deletions

View file

@ -172,4 +172,5 @@ v 2.0:
- Added missing confirmation message on '/manload'.
- Stop the error on shutdown if GM failed to load at startup.
- GroupManager will now generate it's own log (in the GM folder) to keep things tidy, but also to account of those players unable to find/access their server.log.
- Startup errors will now lock out ALL commands other than '/manload'
- Startup errors will now lock out ALL commands other than '/manload'
- Fix 'manuadd' to use the default or selected world (via 'manselect'), if the world is not specified in the command.

View file

@ -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;