Compare commits

..
2 Commits
4 changed files with 35 additions and 30 deletions

No files matched your search

+1 -1
View File
@@ -3,7 +3,7 @@
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<groupId>com.rammelkast.anticheatreloaded</groupId> <groupId>com.rammelkast.anticheatreloaded</groupId>
<artifactId>AntiCheatReloaded</artifactId> <artifactId>AntiCheatReloaded</artifactId>
<version>1.9.0-PRE</version> <version>1.9.0</version>
<name>AntiCheatReloaded</name> <name>AntiCheatReloaded</name>
<url>https://www.spigotmc.org/resources/anticheatreloaded.23799/</url> <url>https://www.spigotmc.org/resources/anticheatreloaded.23799/</url>
<properties> <properties>
@@ -19,39 +19,44 @@
package com.rammelkast.anticheatreloaded.command.executors; package com.rammelkast.anticheatreloaded.command.executors;
import org.bukkit.ChatColor;
import org.bukkit.command.CommandSender; import org.bukkit.command.CommandSender;
import com.rammelkast.anticheatreloaded.AntiCheatReloaded;
import com.rammelkast.anticheatreloaded.check.CheckType; import com.rammelkast.anticheatreloaded.check.CheckType;
import com.rammelkast.anticheatreloaded.command.CommandBase; import com.rammelkast.anticheatreloaded.command.CommandBase;
import com.rammelkast.anticheatreloaded.manage.CheckManager;
import com.rammelkast.anticheatreloaded.util.Permission; import com.rammelkast.anticheatreloaded.util.Permission;
public class CommandChecks extends CommandBase { public class CommandChecks extends CommandBase {
private static final String NAME = "AntiCheatReloaded Checks Management"; private static final String NAME = "AntiCheatReloaded Checks Management";
private static final String COMMAND = "checks"; private static final String COMMAND = "checks";
private static final String USAGE = "anticheat checks"; private static final String USAGE = "anticheat checks";
private static final Permission PERMISSION = Permission.SYSTEM_CHECK; private static final Permission PERMISSION = Permission.SYSTEM_CHECK;
private static final String[] HELP = new String[2]; private static final String[] HELP = new String[2];
static { static {
HELP[0] = GRAY + "Use: " + AQUA + "/anticheat checks" + GRAY + " for a list of checks"; HELP[0] = GRAY + "Use: " + AQUA + "/anticheat checks" + GRAY + " for a list of checks";
StringBuilder builder = new StringBuilder(); StringBuilder builder = new StringBuilder();
builder.append(GRAY + "Checks: "); CheckManager checkManager = AntiCheatReloaded.getManager().getCheckManager();
for (int i=0;i<CheckType.values().length;i++) { builder.append(GRAY + "Checks: ");
builder.append(CheckType.values()[i]); for (int i = 0; i < CheckType.values().length; i++) {
if (i<CheckType.values().length-1) { CheckType type = CheckType.values()[i];
builder.append(", "); builder.append((checkManager.isActive(type) ? ChatColor.GREEN : ChatColor.RED) + type.getName());
} if (i < CheckType.values().length - 1) {
} builder.append(", ");
HELP[1] = builder.toString(); }
} }
HELP[1] = builder.toString();
}
public CommandChecks() { public CommandChecks() {
super(NAME, COMMAND, USAGE, HELP, PERMISSION); super(NAME, COMMAND, USAGE, HELP, PERMISSION);
} }
@Override @Override
protected void execute(CommandSender cs, String[] args) { protected void execute(CommandSender cs, String[] args) {
sendHelp(cs); sendHelp(cs);
} }
} }
@@ -55,7 +55,6 @@ public class CheckManager {
for (CheckType type : CheckType.values()) { for (CheckType type : CheckType.values()) {
if (!configuration.getChecks().isEnabled(type)) { if (!configuration.getChecks().isEnabled(type)) {
checkIgnoreList.add(type); checkIgnoreList.add(type);
break;
} }
} }
+5 -4
View File
@@ -1,4 +1,7 @@
# AntiCheatReloaded checks configuration file # AntiCheatReloaded checks configuration file
# Checks that have multiple modules need to be disabled on a per-module basis
# If you have a false positive and can't determine what subcheck it's from,
# enable debug-mode in config.yml and compare the results against the commented values
# Flight check settings # Flight check settings
# Checks if a player moves wrongly in the air # Checks if a player moves wrongly in the air
flight: flight:
@@ -98,8 +101,6 @@ speed:
# WaterWalk check settings # WaterWalk check settings
# Checks if a player is walking on water # Checks if a player is walking on water
waterwalk: waterwalk:
# Should this check be enabled?
enabled: true
# Checks for vanilla water walking/jumping # Checks for vanilla water walking/jumping
# Debugs as 'tried to walk on water' # Debugs as 'tried to walk on water'
walk: walk:
@@ -109,14 +110,14 @@ waterwalk:
# This combats false positives, while giving hackers not much leniency # This combats false positives, while giving hackers not much leniency
minimumDistXZ: 0.092 minimumDistXZ: 0.092
# Checks for small hops on top of water # Checks for small hops on top of water
# Debugs as 'tried to lunge on water' # Debugs as 'tried to hop on water'
hop: hop:
# Should this part of the check be enabled? # Should this part of the check be enabled?
enabled: true enabled: true
# Maximum lunge Y motion to flag # Maximum lunge Y motion to flag
maxMotionY: 0.10 maxMotionY: 0.10
# Checks for small lunges in water # Checks for small lunges in water
# Debugs as 'tried to walk on water' # Debugs as 'tried to lunge in water'
lunge: lunge:
# Should this part of the check be enabled? # Should this part of the check be enabled?
enabled: true enabled: true