}
@Override
public String[] getPlayerGroups(String world, String player) {
List<String> groupList = new ArrayList<String>();
PermissionInfo info = perms.getPlayerInfo(player);
if (world != null && info != null) {
for (Group group : perms.getPlayerInfo(player).getGroups()) {
if (group.getInfo().getWorlds().contains(world)) {
groupList.add(group.getName());
}
}
return groupList.toArray(new String[0]);
}
if (info != null) {
for (Group group : info.getGroups()) {
groupList.add(group.getName());
}
}
return groupList.toArray(new String[0]);
}