Search in sources :

Example 1 with Rank

use of com.griefdefender.api.clan.Rank in project GDHooks by bloodmc.

the class GDHooks method registerClanCompletions.

public void registerClanCompletions() {
    this.commandManager.getCommandCompletions().registerCompletion("gdclans", c -> {
        Set<String> tags = new HashSet<>();
        for (Clan clan : this.clanProvider.getAllClans()) {
            tags.add(clan.getTag());
        }
        return ImmutableSet.copyOf(tags);
    });
    this.commandManager.getCommandCompletions().registerCompletion("gdclanranks", c -> {
        Set<String> ranks = new HashSet<>();
        for (Clan clan : this.clanProvider.getAllClans()) {
            for (Rank rank : clan.getRanks()) {
                ranks.add(rank.getName().toLowerCase());
            }
        }
        return ImmutableSet.copyOf(ranks);
    });
}
Also used : Clan(com.griefdefender.api.Clan) CommandClanUntrustRank(com.griefdefender.hooks.command.clan.CommandClanUntrustRank) CommandClanTrustRank(com.griefdefender.hooks.command.clan.CommandClanTrustRank) Rank(com.griefdefender.api.clan.Rank) HashSet(java.util.HashSet)

Aggregations

Clan (com.griefdefender.api.Clan)1 Rank (com.griefdefender.api.clan.Rank)1 CommandClanTrustRank (com.griefdefender.hooks.command.clan.CommandClanTrustRank)1 CommandClanUntrustRank (com.griefdefender.hooks.command.clan.CommandClanUntrustRank)1 HashSet (java.util.HashSet)1