use of org.spongepowered.api.text.channel.MutableMessageChannel in project Nucleus by NucleusPowered.
the class IgnoreListener method onChat.
private void onChat(MessageChannelEvent.Chat event, Player player) {
// Reset the channel - but only if we have to.
checkCancels(event.getChannel().orElseGet(event::getOriginalChannel).getMembers(), player).ifPresent(x -> {
MutableMessageChannel mmc = event.getChannel().orElseGet(event::getOriginalChannel).asMutable();
x.forEach(mmc::removeMember);
event.setChannel(mmc);
});
}
Aggregations