コード例 #1
0
  @Override
  public String[] getPlayerGroups(final Player player) {
    final PermissionManager permManager = powerfulPerms.getPermissionManager();
    final List<com.github.cheesesoftware.PowerfulPermsAPI.Group> groups =
        permManager.getPermissionPlayer(player.getUniqueId()).getGroups();
    final String[] newGroups = new String[groups.size()];

    for (int i = 0; i < groups.size(); i++) {
      newGroups[i] = groups.get(i).getName();
    }

    return newGroups;
  }
コード例 #2
0
  /**
   * Get all known groups
   *
   * @return an array of strings containing all setup groups of the permissions plugin.
   */
  @Override
  public String[] getGroups() {
    final PermissionManager permManager = powerfulPerms.getPermissionManager();
    final Map<Integer, com.github.cheesesoftware.PowerfulPermsAPI.Group> groups =
        permManager.getGroups();
    final String[] newGroups = new String[groups.size()];

    int count = 0;

    for (final Entry<Integer, com.github.cheesesoftware.PowerfulPermsAPI.Group> entry :
        groups.entrySet()) {
      newGroups[count] = entry.getValue().getName();
      count++;
    }

    return newGroups;
  }