mirror of
https://github.com/darksaid98/AntiCheatReloaded.git
synced 2026-12-03 14:38:46 +00:00
Added optional op-exemption from checks.
This commit is contained in:
1 parent
5e9b7b4ef0
commit
298fecd749
4 files changed
+16
-9
No files matched your search
@@ -103,14 +103,6 @@ public class BlockListener extends EventListener
|
|||||||
log("tried to break a block of " + block.getType().name() + " too fast.", player, CheckType.FAST_BREAK);
|
log("tried to break a block of " + block.getType().name() + " too fast.", player, CheckType.FAST_BREAK);
|
||||||
noHack = false;
|
noHack = false;
|
||||||
}
|
}
|
||||||
plugin.getServer().getScheduler().scheduleSyncDelayedTask(plugin, new Runnable()
|
|
||||||
{
|
|
||||||
@Override
|
|
||||||
public void run()
|
|
||||||
{
|
|
||||||
backend.checkSwing(player, block);
|
|
||||||
}
|
|
||||||
}, 2L);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (noHack)
|
if (noHack)
|
||||||
|
|||||||
@@ -96,9 +96,14 @@ public class CheckManager
|
|||||||
return exemptList.containsKey(player.getName()) ? exemptList.get(player.getName()).contains(type) : false;
|
return exemptList.containsKey(player.getName()) ? exemptList.get(player.getName()).contains(type) : false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean isOpExempt(Player player)
|
||||||
|
{
|
||||||
|
return (this.manager.getConfiguration().opExempt() && player.isOp());
|
||||||
|
}
|
||||||
|
|
||||||
public boolean willCheck(Player player, CheckType type)
|
public boolean willCheck(Player player, CheckType type)
|
||||||
{
|
{
|
||||||
return isActive(type) && manager.getConfiguration().checkInWorld(player.getWorld()) && !isExempt(player, type) && !type.checkPermission(player) && isOnline(player);
|
return isActive(type) && manager.getConfiguration().checkInWorld(player.getWorld()) && !isExempt(player, type) && !type.checkPermission(player) && isOnline(player) && !isOpExempt(player);
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isOnline(Player player)
|
public boolean isOnline(Player player)
|
||||||
|
|||||||
@@ -47,6 +47,7 @@ public class Configuration
|
|||||||
private boolean chatSpam;
|
private boolean chatSpam;
|
||||||
private boolean commandSpam;
|
private boolean commandSpam;
|
||||||
private boolean silentMode;
|
private boolean silentMode;
|
||||||
|
private boolean opExempt;
|
||||||
private int fileLogLevel = 0;
|
private int fileLogLevel = 0;
|
||||||
private int medThreshold = 0;
|
private int medThreshold = 0;
|
||||||
private int highThreshold = 0;
|
private int highThreshold = 0;
|
||||||
@@ -120,6 +121,11 @@ public class Configuration
|
|||||||
return silentMode;
|
return silentMode;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean opExempt()
|
||||||
|
{
|
||||||
|
return opExempt;
|
||||||
|
}
|
||||||
|
|
||||||
public int medThreshold()
|
public int medThreshold()
|
||||||
{
|
{
|
||||||
return medThreshold;
|
return medThreshold;
|
||||||
@@ -161,6 +167,7 @@ public class Configuration
|
|||||||
silentMode = getBoolean("System.Silent mode", false);
|
silentMode = getBoolean("System.Silent mode", false);
|
||||||
medThreshold = getInt("Events.Medium threshold", 20);
|
medThreshold = getInt("Events.Medium threshold", 20);
|
||||||
highThreshold = getInt("Events.High threshold", 50);
|
highThreshold = getInt("Events.High threshold", 50);
|
||||||
|
opExempt = getBoolean("System.Exempt op", false);
|
||||||
|
|
||||||
if (config.getList("Enable in") == null)
|
if (config.getList("Enable in") == null)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -23,6 +23,7 @@ System:
|
|||||||
#Should AntiCheat log to files?
|
#Should AntiCheat log to files?
|
||||||
#0 = off, 1 = log when an event takes place, 2 = more detailed logs, 3 = most detailed logs
|
#0 = off, 1 = log when an event takes place, 2 = more detailed logs, 3 = most detailed logs
|
||||||
File log level: 1
|
File log level: 1
|
||||||
|
#Should AntiCheat display extra (debug) information when starting?
|
||||||
Verbose startup: false
|
Verbose startup: false
|
||||||
#Should AntiCheat block when players spam messages in chat?
|
#Should AntiCheat block when players spam messages in chat?
|
||||||
Block chat spam: true
|
Block chat spam: true
|
||||||
@@ -32,3 +33,5 @@ System:
|
|||||||
#and AntiCheat will do everything possible to keep them in the dark, but their level will still raise,
|
#and AntiCheat will do everything possible to keep them in the dark, but their level will still raise,
|
||||||
#alerts will still be sent to console and to admins online, and events will still take place.
|
#alerts will still be sent to console and to admins online, and events will still take place.
|
||||||
Silent mode: false
|
Silent mode: false
|
||||||
|
#Should ops be exempt from all checks?
|
||||||
|
Exempt op: false
|
||||||
Reference in new issue
Block a user