public void execute(MessageReceiver caller, String[] args) {
if (args[args.length - 1].equals("--help")) {
Canary.help().getHelp(caller, "playermod group remove");
return;
}
Player target = Canary.getServer().matchPlayer(args[1]);
Group group = Canary.usersAndGroups().getGroup(args[2]);
if (group == null) {
caller.notice(Translator.translateAndFormat("unknown group", args[2]));
return;
}
if (target == null) {
OfflinePlayer oplayer = Canary.getServer().getOfflinePlayer(args[1]);
if (oplayer.removeGroup(group)) {
caller.message(Colors.YELLOW + Translator.translate("modify group removed"));
}
else {
caller.message(Colors.YELLOW + Translator.translate("modify group removed failed"));
}
return;
}
if (target.removeGroup(group)) {
caller.message(Colors.YELLOW + Translator.translate("modify group removed"));
}
else {
caller.message(Colors.YELLOW + Translator.translate("modify group removed failed"));
}