Exposing Clan identifier in ClanMessageChannel

Issue #2 resolved
Hy Nguyen Quy created an issue

As discussed before I would suggest storing Clan identifier inside ClanMessageChannel and exposing it to the outside world via a function like getIdentifier() or getClan(). This would help other plugin to know what clan the message is sending to.

The same can also be done with AllyMessageChannel with getIdentifiers() or getClans().

I really hope you would consider this small change soon :).

Comments (4)

  1. Kippers repo owner

    Added in MCClansAPI v1.2 (used by MCClans v1.4+).

    JavaDoc link.

    Suggested usage:

    MessageChannel messageChannel = ...
    if (messageChannel instanceof ClanMessageChannel) {
        ClanMessageChannel clanMessageChannel = (ClanMessageChannel) messageChannel;
        Clan clan = clanMessageChannel.getClan();
    } else if (messageChannel instanceof AllyMessageChannel) {
        AllyMessageChannel allyMessageChannel = (AllyMessageChannel) messageChannel;
        List<Clan> clans = allyMessageChannel.getClans();
    }
    
  2. Log in to comment