mirror of
https://github.com/darksaid98/AntiCheatReloaded.git
synced 2026-12-03 06:28:52 +00:00
Option to disable chat and command spam, fixes issue #45
This commit is contained in:
1 parent
7454edf8d6
commit
0b6339a529
3 files changed
+36
-5
No files matched your search
@@ -18,6 +18,8 @@
|
||||
|
||||
package net.h31ix.anticheat.event;
|
||||
|
||||
import net.h31ix.anticheat.Anticheat;
|
||||
import net.h31ix.anticheat.Configuration;
|
||||
import net.h31ix.anticheat.manage.Backend;
|
||||
import net.h31ix.anticheat.manage.CheckManager;
|
||||
import net.h31ix.anticheat.manage.CheckType;
|
||||
@@ -39,13 +41,14 @@ import org.bukkit.inventory.PlayerInventory;
|
||||
public class PlayerListener extends EventListener
|
||||
{
|
||||
private final Backend backend = getBackend();
|
||||
private final CheckManager checkManager = getCheckManager();
|
||||
private final CheckManager checkManager = getCheckManager();
|
||||
private final Configuration config = Anticheat.getManager().getConfiguration();
|
||||
|
||||
@EventHandler
|
||||
public void onPlayerCommandPreprocess(PlayerCommandPreprocessEvent event)
|
||||
{
|
||||
Player player = event.getPlayer();
|
||||
if(checkManager.willCheck(player, CheckType.SPAM))
|
||||
if(checkManager.willCheck(player, CheckType.SPAM) && config.commandSpam())
|
||||
{
|
||||
backend.logChat(player);
|
||||
if(backend.checkSpam(player, event.getMessage()))
|
||||
@@ -115,7 +118,7 @@ public class PlayerListener extends EventListener
|
||||
public void onPlayerChat(PlayerChatEvent event)
|
||||
{
|
||||
Player player = event.getPlayer();
|
||||
if(checkManager.willCheck(player, CheckType.SPAM))
|
||||
if(checkManager.willCheck(player, CheckType.SPAM) && config.chatSpam())
|
||||
{
|
||||
backend.logChat(player);
|
||||
if(backend.checkSpam(player, event.getMessage()))
|
||||
|
||||
Reference in new issue
Block a user