mirror of
https://github.com/darksaid98/AntiCheatReloaded.git
synced 2026-12-04 14:38:47 +00:00
Add configuration value for exempting players in creative mode from xray checks
This commit is contained in:
1 parent
bde77cff98
commit
ad690d6976
3 files changed
+18
No files matched your search
@@ -49,6 +49,7 @@ public class Configuration
|
||||
private boolean commandSpam;
|
||||
private boolean silentMode;
|
||||
private boolean opExempt;
|
||||
private boolean trackCreativeXRay;
|
||||
private int fileLogLevel = 0;
|
||||
private int medThreshold = 0;
|
||||
private int highThreshold = 0;
|
||||
@@ -128,6 +129,11 @@ public class Configuration
|
||||
return opExempt;
|
||||
}
|
||||
|
||||
public boolean trackCreativeXRay()
|
||||
{
|
||||
return trackCreativeXRay;
|
||||
}
|
||||
|
||||
public int medThreshold()
|
||||
{
|
||||
return medThreshold;
|
||||
@@ -171,6 +177,7 @@ public class Configuration
|
||||
medThreshold = getInt("Events.Medium threshold", 20);
|
||||
highThreshold = getInt("Events.High threshold", 50);
|
||||
opExempt = getBoolean("System.Exempt op", false);
|
||||
trackCreativeXRay = getBoolean("XRay.Track creative", true);
|
||||
|
||||
if (config.getList("Enable in") == null)
|
||||
{
|
||||
|
||||
@@ -22,6 +22,7 @@ import net.h31ix.anticheat.Anticheat;
|
||||
import net.h31ix.anticheat.manage.CheckManager;
|
||||
import net.h31ix.anticheat.manage.CheckType;
|
||||
import net.h31ix.anticheat.util.Configuration;
|
||||
import org.bukkit.GameMode;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
@@ -40,6 +41,13 @@ public class XRayListener implements Listener
|
||||
if (config.logXRay())
|
||||
{
|
||||
Player p = event.getPlayer();
|
||||
if(p.getGameMode() == GameMode.CREATIVE)
|
||||
{
|
||||
if(!config.trackCreativeXRay())
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
String player = p.getName();
|
||||
if (checkManager.willCheck(p, CheckType.XRAY))
|
||||
{
|
||||
|
||||
@@ -2,7 +2,10 @@
|
||||
# Please report any bugs: http://dev.bukkit.org/server-mods/anticheat/
|
||||
XRay:
|
||||
Log xray stats: true
|
||||
# Should a warning be sent to admins when a person is found that could be xraying?
|
||||
Alert when xray is found: false
|
||||
# Should players in creative mode be tracked for possible xray usage?
|
||||
Track creative: true
|
||||
# Events occur when a player's hack level changes. You may configure reactions to these events here.
|
||||
# Valid events = NONE,WARN,KICK,BAN,COMMAND[command]
|
||||
# Use commands like so: COMMAND[ban &player 30] or COMMAND[kick &player hacking] or COMMAND[jail &player 10]
|
||||
|
||||
Reference in new issue
Block a user