use of com.gmail.nossr50.datatypes.chat.ChatChannel in project Foundation by kangarko.
the class ItemsAdderHook method getActivePartyChat.
String getActivePartyChat(final Player player) {
try {
final McMMOPlayer mcplayer = UserManager.getPlayer(player);
if (mcplayer != null) {
final Party party = mcplayer.getParty();
final ChatChannel channelType = mcplayer.getChatChannel();
return channelType == ChatChannel.PARTY || channelType == ChatChannel.PARTY_OFFICER && party != null ? party.getName() : null;
}
} catch (final Throwable throwable) {
if (!errorLogged) {
Common.warning("Failed getting mcMMO party chat for " + player.getName() + " due to error. Returning null." + " Ensure you have the latest mcMMO version, if so, contact plugin authors to update the integration. Error was: " + throwable);
errorLogged = true;
}
}
return null;
}
Aggregations