1
0
mirror of https://github.com/essentials/Essentials.git synced 2025-09-29 07:39:09 +02:00

addSubGroup now returns a boolean for success/failure.

'/manuaddsub' now correctly reports if it was able to add the sub
group.
This commit is contained in:
ElgarL
2012-01-24 14:21:07 +00:00
parent 1dab4f95dd
commit 145b0be2f3
3 changed files with 23 additions and 14 deletions

View File

@@ -489,8 +489,10 @@ public class GroupManager extends JavaPlugin {
return false;
}
// PARECE OK
auxUser.addSubGroup(auxGroup);
sender.sendMessage(ChatColor.YELLOW + "You added subgroup '" + auxGroup.getName() + "' to player '" + auxUser.getName() + "'.");
if (auxUser.addSubGroup(auxGroup))
sender.sendMessage(ChatColor.YELLOW + "You added subgroup '" + auxGroup.getName() + "' to player '" + auxUser.getName() + "'.");
else
sender.sendMessage(ChatColor.RED + "The subgroup '" + auxGroup.getName() + "' is already available to '" + auxUser.getName() + "'.");
targetPlayer = this.getServer().getPlayer(auxUser.getName());
if (targetPlayer != null)