Esempio n. 1
0
  @Override
  public String getPrimaryGroup(String world, String player) {
    OfflinePlayer op = Bukkit.getOfflinePlayer(player);
    GroupSet set = perms.getGroupManager().getWorldSet(Bukkit.getWorld(world));
    User user = set.getUser(op);

    Set<Group> children = user.getChildren(false);
    if (!children.isEmpty()) {
      return children.iterator().next().getName();
    } else {
      return null;
    }
  }
Esempio n. 2
0
  @Override
  public String[] getPlayerGroups(String world, String player) {
    OfflinePlayer op = Bukkit.getOfflinePlayer(player);
    GroupSet set = perms.getGroupManager().getWorldSet(Bukkit.getWorld(world));
    User user = set.getUser(op);

    Set<Group> children = user.getChildren(true);
    List<String> groups = new ArrayList<String>();
    for (Group child : children) {
      groups.add(child.getName());
    }
    return groups.toArray(new String[groups.size()]);
  }