return handler.inGroup(playerName, groupName);
}
@Override
public boolean playerAddGroup(String worldName, String playerName, String groupName) {
OverloadedWorldHolder owh;
if (worldName == null) {
owh = groupManager.getWorldsHolder().getWorldDataByPlayerName(playerName);
} else {
owh = groupManager.getWorldsHolder().getWorldData(worldName);
}
if (owh == null) {
return false;
}
User user = owh.getUser(playerName);
if (user == null) {
return false;
}
Group group = owh.getGroup(groupName);
if (group == null) {
return false;
}
if (user.getGroup().equals(owh.getDefaultGroup())) {
user.setGroup(group);
} else if (group.getInherits().contains(user.getGroup().getName().toLowerCase())) {
user.setGroup(group);
} else {
user.addSubGroup(group);