Merge branch 'master' of ssh://184.154.0.242:7999/min/Mineplex
This commit is contained in:
commit
1c52bd4f64
@ -61,17 +61,24 @@ public class BotSpamManager extends MiniPlugin
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.LOWEST)
|
||||
public void onChat(AsyncPlayerChatEvent event)
|
||||
public void onChat(final AsyncPlayerChatEvent event)
|
||||
{
|
||||
// Ignore messages sent by staff members
|
||||
if (_clientManager.hasRank(event.getPlayer(), Rank.HELPER))
|
||||
return;
|
||||
|
||||
for (SpamText spamText : _spam)
|
||||
for (final SpamText spamText : _spam)
|
||||
{
|
||||
if (spamText.isEnabled() && spamText.isSpam(event.getMessage()))
|
||||
{
|
||||
punishBot(event.getPlayer(), spamText);
|
||||
runSync(new Runnable()
|
||||
{
|
||||
@Override
|
||||
public void run()
|
||||
{
|
||||
punishBot(event.getPlayer(), spamText);
|
||||
}
|
||||
});
|
||||
event.setCancelled(true);
|
||||
return;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user