Apply profanity filter to chat slash commands.

And whispers.  Doesn't soft mute player or explain, just cancels the
command.  If player is brazen and goes to standard chat, then he'll get
muted there.
This commit is contained in:
ryanhamshire 2016-01-14 10:22:27 -08:00
parent 69c1a2ffd3
commit 884106300e

View File

@ -581,6 +581,11 @@ class PlayerEventHandler implements Listener
{
event.setCancelled(this.handlePlayerChat(event.getPlayer(), event.getMessage(), event));
}
if(!player.hasPermission("griefprevention.spam") && this.bannedWordFinder.hasMatch(message))
{
event.setCancelled(true);
}
//unless cancelled, log in abridged logs
if(!event.isCancelled())