mirror of
https://github.com/darksaid98/AntiCheatReloaded.git
synced 2026-12-01 14:38:56 +00:00
Added GhostHand and Unicode chat check and fixed broken fly check.
Furthermore: + Updated and documented magic.yml + Added support for missing CAVE_AIR material + Average ping for blink check can now be configured + Removed /acr update from help command + Added UpdateManager.java to be used in future update messages + Better MainHand/OffHand support I've been busy :)
This commit is contained in:
1 parent
acea36929b
commit
fec1286c8d
22 files changed
+596
-193
No files matched your search
@@ -43,4 +43,6 @@ Hacks blocked
|
||||
* FastBreak
|
||||
* FastPlace
|
||||
* Spam
|
||||
* FastEat
|
||||
* FastEat
|
||||
* ElytraFly
|
||||
* Unicode chat
|
||||
@@ -3,7 +3,7 @@
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>com.rammelkast.anticheatreloaded</groupId>
|
||||
<artifactId>AntiCheatReloaded</artifactId>
|
||||
<version>1.7.1-ALPHA</version>
|
||||
<version>1.8.0-ALPHA</version>
|
||||
<name>AntiCheatReloaded</name>
|
||||
<url>https://rammelkast.com</url>
|
||||
<properties>
|
||||
|
||||
@@ -158,15 +158,6 @@ public class AntiCheatReloaded extends JavaPlugin {
|
||||
return kicked;
|
||||
}
|
||||
}));
|
||||
metrics.addCustomChart(new Metrics.SingleLineChart("glide_violations", new Callable<Integer>() {
|
||||
@Override
|
||||
public Integer call() throws Exception {
|
||||
int violations = glideViolations;
|
||||
// Reset so we don't keep sending the same value
|
||||
glideViolations = 0;
|
||||
return violations;
|
||||
}
|
||||
}));
|
||||
metrics.addCustomChart(new Metrics.SimplePie("protocollib_version", new Callable<String>() {
|
||||
@Override
|
||||
public String call() throws Exception {
|
||||
@@ -300,19 +291,11 @@ public class AntiCheatReloaded extends JavaPlugin {
|
||||
* Amount of players kicked since start
|
||||
*/
|
||||
private int playersKicked = 0;
|
||||
/**
|
||||
* Amount of glide violations since start
|
||||
*/
|
||||
private int glideViolations = 0;
|
||||
|
||||
public void onPlayerKicked() {
|
||||
this.playersKicked++;
|
||||
}
|
||||
|
||||
public void onGlideViolation() {
|
||||
this.glideViolations++;
|
||||
}
|
||||
|
||||
public static void sendToMainThread(Runnable runnable) {
|
||||
Bukkit.getServer().getScheduler().runTask(AntiCheatReloaded.getPlugin(), runnable);
|
||||
}
|
||||
|
||||
@@ -41,6 +41,7 @@ import org.bukkit.potion.PotionEffectType;
|
||||
import com.rammelkast.anticheatreloaded.AntiCheatReloaded;
|
||||
import com.rammelkast.anticheatreloaded.check.combat.VelocityCheck;
|
||||
import com.rammelkast.anticheatreloaded.check.movement.BlinkCheck;
|
||||
import com.rammelkast.anticheatreloaded.check.movement.ElytraCheck;
|
||||
import com.rammelkast.anticheatreloaded.check.movement.FlightCheck;
|
||||
import com.rammelkast.anticheatreloaded.check.movement.GlideCheck;
|
||||
import com.rammelkast.anticheatreloaded.check.movement.SpeedCheck;
|
||||
@@ -173,6 +174,7 @@ public class Backend {
|
||||
GlideCheck.LAST_FALL_DISTANCE.remove(pU);
|
||||
GlideCheck.VIOLATIONS.remove(pU);
|
||||
SpeedCheck.SPEED_VIOLATIONS.remove(player.getUniqueId());
|
||||
ElytraCheck.JUMP_Y_VALUE.remove(player.getUniqueId().toString());
|
||||
}
|
||||
|
||||
public CheckResult checkFastBow(Player player, float force) {
|
||||
@@ -411,22 +413,29 @@ public class Backend {
|
||||
if (player.hasPotionEffect(PotionEffectType.JUMP)) {
|
||||
max += 12;
|
||||
string = " with jump potion";
|
||||
}
|
||||
Block block = player.getLocation().getBlock();
|
||||
if (!isMovingExempt(player) && !Utilities.isInWater(player) && !VersionUtil.isFlying(player) && !justBroke(player) && !Utilities.isClimbableBlock(player.getLocation().getBlock()) && !player.isInsideVehicle() && !YAxisCheck.isMoveUpBlock(player.getLocation().add(0, -1, 0).getBlock()) && !YAxisCheck.isMoveUpBlock(player.getLocation().add(0, -1.5, 0).getBlock())) {
|
||||
if (y1 < y2) {
|
||||
if (!block.getRelative(BlockFace.NORTH).isLiquid() && !block.getRelative(BlockFace.SOUTH).isLiquid() && !block.getRelative(BlockFace.EAST).isLiquid() && !block.getRelative(BlockFace.WEST).isLiquid()) {
|
||||
increment(player, ascensionCount, max);
|
||||
if (ascensionCount.get(player.getUniqueId()) >= max) {
|
||||
return new CheckResult(CheckResult.Result.FAILED, player.getName() + " ascended " + ascensionCount.get(player.getUniqueId()) + " times in a row (max = " + max + string + ")");
|
||||
}
|
||||
}
|
||||
} else {
|
||||
ascensionCount.put(player.getUniqueId(), 0);
|
||||
}
|
||||
}
|
||||
return PASS;
|
||||
}
|
||||
}
|
||||
Block block = player.getLocation().getBlock();
|
||||
if (!isMovingExempt(player) && !Utilities.isInWater(player) && !VersionUtil.isFlying(player)
|
||||
&& !justBroke(player) && !Utilities.isClimbableBlock(player.getLocation().getBlock())
|
||||
&& !player.isInsideVehicle() && !YAxisCheck.isMoveUpBlock(player.getLocation().add(0, -1, 0).getBlock())
|
||||
&& !YAxisCheck.isMoveUpBlock(player.getLocation().add(0, -1.5, 0).getBlock())) {
|
||||
if (y1 < y2) {
|
||||
if (!block.getRelative(BlockFace.NORTH).isLiquid() && !block.getRelative(BlockFace.SOUTH).isLiquid()
|
||||
&& !block.getRelative(BlockFace.EAST).isLiquid()
|
||||
&& !block.getRelative(BlockFace.WEST).isLiquid()) {
|
||||
increment(player, ascensionCount, max);
|
||||
if (ascensionCount.get(player.getUniqueId()) >= max) {
|
||||
return new CheckResult(CheckResult.Result.FAILED,
|
||||
player.getName() + " ascended " + ascensionCount.get(player.getUniqueId())
|
||||
+ " times in a row (max = " + max + string + ")");
|
||||
}
|
||||
}
|
||||
} else {
|
||||
ascensionCount.put(player.getUniqueId(), 0);
|
||||
}
|
||||
}
|
||||
return PASS;
|
||||
}
|
||||
|
||||
public CheckResult checkSwing(Player player, Block block) {
|
||||
UUID uuid = player.getUniqueId();
|
||||
@@ -566,14 +575,14 @@ public class Backend {
|
||||
}
|
||||
Long l = user.getMessageTime(i);
|
||||
|
||||
if (System.currentTimeMillis() - l > magic.CHAT_REPEAT_MIN() * 100) {
|
||||
if (System.currentTimeMillis() - l > magic.CHAT_REPEAT_MIN()) {
|
||||
user.clearMessages();
|
||||
break;
|
||||
} else {
|
||||
if (manager.getConfiguration().getConfig().blockChatSpamRepetition.getValue() && m.equalsIgnoreCase(msg) && i == 1) {
|
||||
manager.getLoggingManager().logFineInfo(player.getName() + " spam-repeated \"" + msg + "\"");
|
||||
return new CheckResult(CheckResult.Result.FAILED, lang.SPAM_WARNING());
|
||||
} else if (manager.getConfiguration().getConfig().blockChatSpamSpeed.getValue() && System.currentTimeMillis() - user.getLastCommandTime() < magic.COMMAND_MIN() * 2) {
|
||||
} else if (manager.getConfiguration().getConfig().blockChatSpamSpeed.getValue() && System.currentTimeMillis() - user.getLastCommandTime() < magic.CHAT_MIN()) {
|
||||
manager.getLoggingManager().logFineInfo(player.getName() + " spammed quickly \"" + msg + "\"");
|
||||
return new CheckResult(CheckResult.Result.FAILED, lang.SPAM_WARNING());
|
||||
}
|
||||
@@ -609,13 +618,13 @@ public class Backend {
|
||||
}
|
||||
Long l = user.getCommandTime(i);
|
||||
|
||||
if (System.currentTimeMillis() - l > magic.COMMAND_REPEAT_MIN() * 100) {
|
||||
if (System.currentTimeMillis() - l > magic.COMMAND_REPEAT_MIN()) {
|
||||
user.clearCommands();
|
||||
break;
|
||||
} else {
|
||||
if (manager.getConfiguration().getConfig().blockCommandSpamRepetition.getValue() && m.equalsIgnoreCase(cmd) && i == 1) {
|
||||
return new CheckResult(CheckResult.Result.FAILED, lang.SPAM_WARNING());
|
||||
} else if (manager.getConfiguration().getConfig().blockCommandSpamSpeed.getValue() && System.currentTimeMillis() - user.getLastCommandTime() < magic.COMMAND_MIN() * 2) {
|
||||
} else if (manager.getConfiguration().getConfig().blockCommandSpamSpeed.getValue() && System.currentTimeMillis() - user.getLastCommandTime() < magic.COMMAND_MIN()) {
|
||||
return new CheckResult(CheckResult.Result.FAILED, lang.SPAM_WARNING());
|
||||
}
|
||||
}
|
||||
@@ -656,8 +665,8 @@ public class Backend {
|
||||
}
|
||||
|
||||
public CheckResult checkSprintDamage(Player player) {
|
||||
if (isDoing(player, sprinted, magic.SPRINT_MIN())) {
|
||||
return new CheckResult(CheckResult.Result.FAILED, player.getName() + " sprinted and damaged an entity too fast (min sprint=" + magic.SPRINT_MIN() + " ms)");
|
||||
if (isDoing(player, sprinted, magic.SPRINT_MAX())) {
|
||||
return new CheckResult(CheckResult.Result.FAILED, player.getName() + " sprinted and damaged an entity too fast (min sprint=" + magic.SPRINT_MAX() + " ms)");
|
||||
} else {
|
||||
return PASS;
|
||||
}
|
||||
@@ -794,6 +803,7 @@ public class Backend {
|
||||
GlideCheck.LAST_FALL_DISTANCE.remove(player.getUniqueId());
|
||||
GlideCheck.LAST_DIFFERENCE.remove(player.getUniqueId());
|
||||
GlideCheck.VIOLATIONS.remove(player.getUniqueId());
|
||||
ElytraCheck.JUMP_Y_VALUE.remove(player.getUniqueId().toString());
|
||||
}
|
||||
|
||||
public void logExitFly(final Player player) {
|
||||
|
||||
@@ -36,11 +36,8 @@ import java.util.UUID;
|
||||
*/
|
||||
|
||||
public enum CheckType {
|
||||
ZOMBE_FLY(Permission.CHECK_ZOMBE_FLY),
|
||||
ZOMBE_NOCLIP(Permission.CHECK_ZOMBE_NOCLIP),
|
||||
ZOMBE_CHEAT(Permission.CHECK_ZOMBE_CHEAT),
|
||||
FLIGHT(Permission.CHECK_FLIGHT),
|
||||
ELYTRA(Permission.CHECK_FLIGHT),
|
||||
ELYTRAFLY(Permission.CHECK_FLIGHT),
|
||||
WATER_WALK(Permission.CHECK_WATERWALK),
|
||||
NO_SWING(Permission.CHECK_NOSWING),
|
||||
FAST_BREAK(Permission.CHECK_FASTBREAK),
|
||||
@@ -65,8 +62,9 @@ public enum CheckType {
|
||||
BLINK(Permission.CHECK_BLINK),
|
||||
VELOCITY(Permission.CHECK_VELOCITY),
|
||||
CRITICALS(Permission.CHECK_CRITICALS),
|
||||
CHAT_UNICODE(Permission.CHECK_UNICODE);
|
||||
|
||||
CHAT_UNICODE(Permission.CHECK_UNICODE),
|
||||
GHOSTHAND(Permission.CHECK_GHOSTHAND);
|
||||
|
||||
private final Permission permission;
|
||||
private final Map<UUID, Integer> level = new HashMap<UUID, Integer>();
|
||||
|
||||
|
||||
@@ -23,7 +23,6 @@ import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.UUID;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.scheduler.BukkitRunnable;
|
||||
@@ -72,7 +71,9 @@ public class BlinkCheck {
|
||||
int ping = VersionUtil.getPlayerPing(p);
|
||||
int blinkMagic = AntiCheatReloaded.getManager().getBackend()
|
||||
.getMagic().BLINK_PACKET();
|
||||
float pingLeniency = (float) ((ping / 120));
|
||||
int averagePing = AntiCheatReloaded.getManager().getBackend()
|
||||
.getMagic().BLINK_AVERAGE_PING();
|
||||
float pingLeniency = (float) ((ping / averagePing));
|
||||
if (pingLeniency < 1) pingLeniency = 1;
|
||||
if (pingLeniency > 3) pingLeniency = 3;
|
||||
blinkMagic = Math.round(pingLeniency * blinkMagic);
|
||||
|
||||
@@ -19,39 +19,71 @@
|
||||
|
||||
package com.rammelkast.anticheatreloaded.check.movement;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.block.BlockFace;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.potion.PotionEffectType;
|
||||
|
||||
import com.rammelkast.anticheatreloaded.AntiCheatReloaded;
|
||||
import com.rammelkast.anticheatreloaded.check.CheckResult;
|
||||
import com.rammelkast.anticheatreloaded.util.Distance;
|
||||
import com.rammelkast.anticheatreloaded.util.Utilities;
|
||||
|
||||
/**
|
||||
* TODO
|
||||
*/
|
||||
public class ElytraCheck {
|
||||
|
||||
public static final HashMap<String, Double> JUMP_Y_VALUE = new HashMap<String, Double>();
|
||||
private static final CheckResult PASS = new CheckResult(CheckResult.Result.PASSED);
|
||||
|
||||
public static CheckResult runCheck(Player player, Distance distance) {
|
||||
String uuid = player.getUniqueId().toString();
|
||||
if (distance.getYDifference() > AntiCheatReloaded.getManager().getBackend().getMagic().TELEPORT_MIN()) {
|
||||
// This was a teleport, so skip check.
|
||||
JUMP_Y_VALUE.remove(uuid);
|
||||
return PASS;
|
||||
}
|
||||
/*if (!FlightCheck.isMovingExempt(player) && !Utilities.isHoveringOverWater(player.getLocation(), 1)
|
||||
&& Utilities.cantStandAtExp(player.getLocation())
|
||||
&& Utilities.blockIsnt(player.getLocation().getBlock().getRelative(BlockFace.DOWN),
|
||||
new Material[] { Material.FENCE, Material.FENCE_GATE, Material.COBBLE_WALL,
|
||||
Material.ACACIA_FENCE, Material.ACACIA_FENCE_GATE, Material.BIRCH_FENCE,
|
||||
Material.BIRCH_FENCE_GATE, Material.DARK_OAK_FENCE, Material.DARK_OAK_FENCE_GATE,
|
||||
Material.IRON_FENCE, Material.JUNGLE_FENCE, Material.JUNGLE_FENCE_GATE,
|
||||
Material.fence, Material.SPRUCE_FENCE, Material.SPRUCE_FENCE_GATE, Material.IRON_BARS })) {
|
||||
|
||||
}*/
|
||||
//TODO 1.15 update
|
||||
|
||||
if (player.isFlying() || player.hasPotionEffect(PotionEffectType.LEVITATION) || !player.isGliding()) {
|
||||
JUMP_Y_VALUE.remove(uuid);
|
||||
return PASS;
|
||||
}
|
||||
|
||||
double changeY = distance.toY() - distance.fromY();
|
||||
boolean upwardMovement = changeY > 0;
|
||||
if (player.getInventory().getItemInMainHand().getType() == Material.TRIDENT) {
|
||||
if (upwardMovement) {
|
||||
// TODO continue check here
|
||||
JUMP_Y_VALUE.remove(uuid);
|
||||
return PASS;
|
||||
}
|
||||
}
|
||||
|
||||
if (changeY == 0.0D) {
|
||||
// Seen no false positives here yet
|
||||
return new CheckResult(CheckResult.Result.FAILED,
|
||||
player.getName() + " had no Y-axis dropoff when gliding with Elytra");
|
||||
}
|
||||
|
||||
if (!JUMP_Y_VALUE.containsKey(uuid)) {
|
||||
JUMP_Y_VALUE.put(uuid, distance.toY());
|
||||
return PASS;
|
||||
}
|
||||
double lastY = JUMP_Y_VALUE.get(uuid);
|
||||
if (lastY < distance.toY()) {
|
||||
double diff = distance.toY() - lastY;
|
||||
if (diff > 0.7675) {
|
||||
if (!AntiCheatReloaded.getManager().getBackend().silentMode()) {
|
||||
Location to = player.getLocation();
|
||||
to.setY(to.getY() - diff);
|
||||
player.teleport(to);
|
||||
}
|
||||
return new CheckResult(CheckResult.Result.FAILED,
|
||||
player.getName() + " tried to glide above jump level");
|
||||
}
|
||||
}
|
||||
return PASS;
|
||||
}
|
||||
|
||||
|
||||
@@ -56,11 +56,8 @@ public class FlightCheck {
|
||||
&& Utilities.cantStandAtExp(player.getLocation())
|
||||
&& Utilities.blockIsnt(player.getLocation().getBlock().getRelative(BlockFace.DOWN),
|
||||
new Material[] { Material.IRON_BARS })
|
||||
&& Utilities.blockIsnt(player.getLocation().getBlock().getRelative(BlockFace.DOWN), new String[] {
|
||||
"FENCE",
|
||||
"FENCE_GATE"
|
||||
})) {
|
||||
|
||||
&& Utilities.blockIsnt(player.getLocation().getBlock().getRelative(BlockFace.DOWN),
|
||||
new String[] { "FENCE", "FENCE_GATE" })) {
|
||||
if (!BLOCKS_OVER_FLIGHT.containsKey(uuid)) {
|
||||
BLOCKS_OVER_FLIGHT.put(uuid, 0D);
|
||||
}
|
||||
@@ -72,8 +69,8 @@ public class FlightCheck {
|
||||
BLOCKS_OVER_FLIGHT.put(uuid, (BLOCKS_OVER_FLIGHT.get(uuid) - distance.getYDifference()));
|
||||
}
|
||||
|
||||
if (BLOCKS_OVER_FLIGHT.get(uuid) > AntiCheatReloaded.getManager().getBackend().getMagic().FLIGHT_BLOCK_LIMIT()
|
||||
&& (y1 <= y2)) {
|
||||
if (BLOCKS_OVER_FLIGHT.get(uuid) > AntiCheatReloaded.getManager().getBackend().getMagic()
|
||||
.FLIGHT_BLOCK_LIMIT() && (y1 <= y2)) {
|
||||
return new CheckResult(CheckResult.Result.FAILED,
|
||||
player.getName() + " flew over " + BLOCKS_OVER_FLIGHT.get(uuid) + " blocks (max="
|
||||
+ AntiCheatReloaded.getManager().getBackend().getMagic().FLIGHT_BLOCK_LIMIT() + ")");
|
||||
@@ -81,7 +78,6 @@ public class FlightCheck {
|
||||
} else {
|
||||
BLOCKS_OVER_FLIGHT.put(uuid, 0D);
|
||||
}
|
||||
|
||||
return PASS;
|
||||
}
|
||||
|
||||
|
||||
@@ -67,11 +67,11 @@ public class GlideCheck {
|
||||
if (VIOLATIONS.get(player.getUniqueId()) + 1 >= AntiCheatReloaded.getManager().getBackend().getMagic()
|
||||
.GLIDE_LIMIT()) {
|
||||
VIOLATIONS.remove(player.getUniqueId());
|
||||
Location to = player.getLocation();
|
||||
to.setY(to.getY() - distanceToFall(to));
|
||||
player.teleport(to);
|
||||
// Report glide violation to statistics, just for the lulz jk
|
||||
AntiCheatReloaded.getPlugin().onGlideViolation();
|
||||
if (!AntiCheatReloaded.getManager().getBackend().silentMode()) {
|
||||
Location to = player.getLocation();
|
||||
to.setY(to.getY() - distanceToFall(to));
|
||||
player.teleport(to);
|
||||
}
|
||||
return new CheckResult(CheckResult.Result.FAILED,
|
||||
player.getName() + " was set back for gliding (yDiff="
|
||||
+ new BigDecimal(yDiff).setScale(2, RoundingMode.HALF_UP) + ")");
|
||||
@@ -90,7 +90,8 @@ public class GlideCheck {
|
||||
private static double distanceToFall(Location location) {
|
||||
location = location.clone();
|
||||
double firstY = location.getY();
|
||||
while (location.clone().add(0, -0.1, 0).getBlock().getType() == Material.AIR)
|
||||
Material subtractType = location.clone().add(0, -0.1, 0).getBlock().getType();
|
||||
while (subtractType == Material.AIR || subtractType == Material.CAVE_AIR)
|
||||
location.add(0, -0.1, 0);
|
||||
return firstY - location.getY();
|
||||
}
|
||||
|
||||
@@ -36,7 +36,8 @@ import com.rammelkast.anticheatreloaded.util.Utilities;
|
||||
import com.rammelkast.anticheatreloaded.util.VersionUtil;
|
||||
|
||||
/**
|
||||
* This check seems to be broken/outdated
|
||||
* This check should be replaced
|
||||
* It works, but not great
|
||||
*/
|
||||
public class WaterWalkCheck {
|
||||
|
||||
|
||||
@@ -77,7 +77,7 @@ public class YAxisCheck {
|
||||
LAST_Y_AXIS_VIOLATION.put(uuid, System.currentTimeMillis());
|
||||
if (!AntiCheatReloaded.getManager().getBackend().silentMode()) {
|
||||
g.setY(LAST_Y_COORD_CACHE.get(uuid));
|
||||
if (g.getBlock().getType() == Material.AIR) {
|
||||
if (g.getBlock().getType() == Material.AIR || g.getBlock().getType() == Material.CAVE_AIR) {
|
||||
player.teleport(g);
|
||||
}
|
||||
}
|
||||
@@ -103,7 +103,7 @@ public class YAxisCheck {
|
||||
LAST_Y_AXIS_VIOLATION.put(uuid, System.currentTimeMillis());
|
||||
if (!AntiCheatReloaded.getManager().getBackend().silentMode()) {
|
||||
g.setY(LAST_Y_COORD_CACHE.get(uuid));
|
||||
if (g.getBlock().getType() == Material.AIR) {
|
||||
if (g.getBlock().getType() == Material.AIR || g.getBlock().getType() == Material.CAVE_AIR) {
|
||||
player.teleport(g);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,18 +19,77 @@
|
||||
|
||||
package com.rammelkast.anticheatreloaded.check.player;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.UUID;
|
||||
import java.util.List;
|
||||
|
||||
import org.bukkit.GameMode;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.Event;
|
||||
import org.bukkit.event.block.BlockBreakEvent;
|
||||
import org.bukkit.event.block.BlockPlaceEvent;
|
||||
|
||||
import com.rammelkast.anticheatreloaded.AntiCheatReloaded;
|
||||
import com.rammelkast.anticheatreloaded.check.CheckResult;
|
||||
import com.rammelkast.anticheatreloaded.config.providers.Magic;
|
||||
import com.rammelkast.anticheatreloaded.util.Utilities;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Rammelkast
|
||||
*
|
||||
*/
|
||||
public class GhosthandCheck {
|
||||
|
||||
public static final Map<UUID, Integer> FLAG_COUNT = new HashMap<UUID, Integer>();
|
||||
public static final int MAX_FLAGS = 3; // TODO config?
|
||||
private static final CheckResult PASS = new CheckResult(CheckResult.Result.PASSED);
|
||||
|
||||
public static CheckResult performCheck(Player player, Event event) {
|
||||
if (event instanceof BlockPlaceEvent) {
|
||||
return checkBlockPlace(player, (BlockPlaceEvent) event);
|
||||
} else if (event instanceof BlockBreakEvent) {
|
||||
return checkBlockBreak(player, (BlockBreakEvent) event);
|
||||
}
|
||||
return PASS;
|
||||
}
|
||||
|
||||
private static CheckResult checkBlockBreak(Player player, BlockBreakEvent event) {
|
||||
if (!isValidBreakTarget(player, event.getBlock())) {
|
||||
return new CheckResult(CheckResult.Result.FAILED,
|
||||
player.getName() + " tried to break a block which was out of view");
|
||||
}
|
||||
return PASS;
|
||||
}
|
||||
|
||||
private static CheckResult checkBlockPlace(Player player, BlockPlaceEvent event) {
|
||||
if (!isValidPlaceTarget(player, event.getBlock())) {
|
||||
return new CheckResult(CheckResult.Result.FAILED,
|
||||
player.getName() + " tried to place a block out of their view");
|
||||
}
|
||||
return PASS;
|
||||
}
|
||||
|
||||
private static boolean isValidPlaceTarget(Player player, Block block) {
|
||||
Magic magic = AntiCheatReloaded.getManager().getConfiguration().getMagic();
|
||||
double distance =
|
||||
player.getGameMode() == GameMode.CREATIVE ? magic.BLOCK_MAX_DISTANCE_CREATIVE()
|
||||
: player.getLocation().getDirection().getY() > 0.9 ? magic.BLOCK_MAX_DISTANCE_CREATIVE()
|
||||
: magic.BLOCK_MAX_DISTANCE();
|
||||
Block targetBlock = player.getTargetBlockExact((int) Math.ceil(distance));
|
||||
if (Utilities.isClimbableBlock(targetBlock)) {
|
||||
if (targetBlock.getLocation().distance(player.getLocation()) <= distance) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return targetBlock.equals(block) || targetBlock.getLocation().distance(block.getLocation()) <= 1.51;
|
||||
}
|
||||
|
||||
private static boolean isValidBreakTarget(Player player, Block block) {
|
||||
Magic magic = AntiCheatReloaded.getManager().getConfiguration().getMagic();
|
||||
double distance =
|
||||
player.getGameMode() == GameMode.CREATIVE ? magic.BLOCK_MAX_DISTANCE_CREATIVE()
|
||||
: player.getLocation().getDirection().getY() > 0.9 ? magic.BLOCK_MAX_DISTANCE_CREATIVE()
|
||||
: magic.BLOCK_MAX_DISTANCE();
|
||||
List<Block> targetBlocks = player.getLastTwoTargetBlocks(null, (int) Math.ceil(distance));
|
||||
for (Block target : targetBlocks) {
|
||||
if (Utilities.isClimbableBlock(target)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return targetBlocks.contains(block);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -33,7 +33,6 @@ public class CommandHelp extends CommandBase {
|
||||
private static final String[] HELP = {
|
||||
RED + "/acr " + GRAY + "help",
|
||||
RED + "/acr " + GRAY + "reload",
|
||||
RED + "/acr " + GRAY + "update",
|
||||
RED + "/acr " + GRAY + "check " + WHITE + "[check] [on/off]",
|
||||
RED + "/acr " + GRAY + "log " + WHITE + "[file/console] [on/off]",
|
||||
RED + "/acr " + GRAY + "report " + WHITE + "[group/user]",
|
||||
|
||||
@@ -154,10 +154,6 @@ public interface Magic {
|
||||
* Number of chat spam violations before action two is executed; Type=INTEGER, Leniency=INCREASE.
|
||||
*/
|
||||
public int CHAT_ACTION_TWO_LEVEL();
|
||||
/**
|
||||
* Number of times a player can be caught in-flight before action is taken; Type=INTEGER, Leniency=INCREASE.
|
||||
*/
|
||||
public int FLIGHT_LIMIT();
|
||||
/**
|
||||
* Number of times a player can be caught in-glide before action is taken; Type=INTEGER, Leniency=INCREASE.
|
||||
*/
|
||||
@@ -235,7 +231,7 @@ public interface Magic {
|
||||
*/
|
||||
public int COMMAND_REPEAT_MIN();
|
||||
/**
|
||||
* Minimum time between chats; Type=SYSTEM, Leniency=INCREASE.
|
||||
* Minimum time between chats; Type=SYSTEM, Leniency=DECREASE.
|
||||
*/
|
||||
public int CHAT_MIN();
|
||||
/**
|
||||
@@ -245,7 +241,7 @@ public interface Magic {
|
||||
/**
|
||||
* Maximum speed you can travel while sprinting; Type=DOUBLE, Leniency=INCREASE.
|
||||
*/
|
||||
public double SPRINT_MIN();
|
||||
public double SPRINT_MAX();
|
||||
/**
|
||||
* Minimum time in between block breaks; Type=INTEGER, Leniency=DECREASE.
|
||||
*/
|
||||
@@ -263,7 +259,7 @@ public interface Magic {
|
||||
*/
|
||||
public double BOW_ERROR();
|
||||
/**
|
||||
* Minimum distance a player can break a block from; Type=DOUBLE, Leniency=INCREASE.
|
||||
* Maximum distance a player can break a block from; Type=DOUBLE, Leniency=INCREASE.
|
||||
*/
|
||||
public double BLOCK_MAX_DISTANCE();
|
||||
/**
|
||||
@@ -271,11 +267,11 @@ public interface Magic {
|
||||
*/
|
||||
public double BLOCK_MAX_DISTANCE_CREATIVE();
|
||||
/**
|
||||
* Minimum distance a player can damage an entity from; Type=DOUBLE, Leniency=INCREASE.
|
||||
* Maximum distance a player can damage an entity from; Type=DOUBLE, Leniency=INCREASE.
|
||||
*/
|
||||
public double ENTITY_MAX_DISTANCE();
|
||||
/**
|
||||
* Minimum distance a player can damage an entity from in creative mode; Type=DOUBLE, Leniency=INCREASE.
|
||||
* Maximum distance a player can damage an entity from in creative mode; Type=DOUBLE, Leniency=INCREASE.
|
||||
*/
|
||||
public double ENTITY_MAX_DISTANCE_CREATIVE();
|
||||
/**
|
||||
@@ -366,14 +362,14 @@ public interface Magic {
|
||||
* Minimum travel distance for move to be considered a teleport and subsequently be ignored; Type=INTEGER, Leniency=INCREASE.
|
||||
*/
|
||||
public int TELEPORT_MIN();
|
||||
/**
|
||||
* Maximum amount of times a player can hit a killaura bot; Type=INTEGER, Leniency=INCREASE.
|
||||
*/
|
||||
public int KILLAURA_BOTHITS();
|
||||
/**
|
||||
* Maximum amount of packets a player can send in a second; Type=INTEGER, Leniency=INCREASE.
|
||||
*/
|
||||
public int BLINK_PACKET();
|
||||
/**
|
||||
* The average ping settings used to account for lag; TYPE=INTEGER, Leniency=INCREASE
|
||||
*/
|
||||
public int BLINK_AVERAGE_PING();
|
||||
/**
|
||||
* Maximum amount of low/zero velocity before flagging; Type=INTEGER, Leniency=INCREASE.
|
||||
*/
|
||||
|
||||
@@ -30,6 +30,7 @@ import org.bukkit.event.block.BlockPlaceEvent;
|
||||
import com.rammelkast.anticheatreloaded.AntiCheatReloaded;
|
||||
import com.rammelkast.anticheatreloaded.check.CheckResult;
|
||||
import com.rammelkast.anticheatreloaded.check.CheckType;
|
||||
import com.rammelkast.anticheatreloaded.check.player.GhosthandCheck;
|
||||
import com.rammelkast.anticheatreloaded.util.Distance;
|
||||
import com.rammelkast.anticheatreloaded.util.Utilities;
|
||||
|
||||
@@ -55,17 +56,28 @@ public class BlockListener extends EventListener {
|
||||
@EventHandler(ignoreCancelled = true)
|
||||
public void onBlockPlace(BlockPlaceEvent event) {
|
||||
final Player player = event.getPlayer();
|
||||
if (player != null && getCheckManager().willCheck(player, CheckType.FAST_PLACE)) {
|
||||
boolean noHack = true;
|
||||
if (getCheckManager().willCheck(player, CheckType.FAST_PLACE)) {
|
||||
CheckResult result = getBackend().checkFastPlace(player);
|
||||
if (result.failed()) {
|
||||
event.setCancelled(!silentMode());
|
||||
log(result.getMessage(), player, CheckType.FAST_PLACE);
|
||||
} else {
|
||||
decrease(player);
|
||||
getBackend().logBlockPlace(player);
|
||||
}
|
||||
noHack = false;
|
||||
}
|
||||
}
|
||||
|
||||
if (getCheckManager().willCheck(player, CheckType.GHOSTHAND)) {
|
||||
CheckResult result = GhosthandCheck.performCheck(player, event);
|
||||
if (result.failed()) {
|
||||
event.setCancelled(!silentMode());
|
||||
log(result.getMessage(), player, CheckType.GHOSTHAND);
|
||||
noHack = false;
|
||||
}
|
||||
}
|
||||
if (noHack) {
|
||||
decrease(player);
|
||||
getBackend().logBlockPlace(player);
|
||||
}
|
||||
|
||||
AntiCheatReloaded.getManager().addEvent(event.getEventName(), event.getHandlers().getRegisteredListeners());
|
||||
}
|
||||
|
||||
@@ -74,32 +86,38 @@ public class BlockListener extends EventListener {
|
||||
final Player player = event.getPlayer();
|
||||
final Block block = event.getBlock();
|
||||
boolean noHack = true;
|
||||
if (player != null) {
|
||||
CheckResult result;
|
||||
if (getCheckManager().willCheck(player, CheckType.FAST_BREAK)) {
|
||||
result = getBackend().checkFastBreak(player, block);
|
||||
if (result.failed()) {
|
||||
event.setCancelled(!silentMode());
|
||||
log(result.getMessage(), player, CheckType.FAST_BREAK);
|
||||
noHack = false;
|
||||
}
|
||||
CheckResult result;
|
||||
if (getCheckManager().willCheck(player, CheckType.FAST_BREAK)) {
|
||||
result = getBackend().checkFastBreak(player, block);
|
||||
if (result.failed()) {
|
||||
event.setCancelled(!silentMode());
|
||||
log(result.getMessage(), player, CheckType.FAST_BREAK);
|
||||
noHack = false;
|
||||
}
|
||||
if (getCheckManager().willCheck(player, CheckType.NO_SWING)) {
|
||||
result = getBackend().checkSwing(player, block);
|
||||
if (result.failed()) {
|
||||
event.setCancelled(!silentMode());
|
||||
log(result.getMessage(), player, CheckType.NO_SWING);
|
||||
noHack = false;
|
||||
}
|
||||
}
|
||||
if (getCheckManager().willCheck(player, CheckType.NO_SWING)) {
|
||||
result = getBackend().checkSwing(player, block);
|
||||
if (result.failed()) {
|
||||
event.setCancelled(!silentMode());
|
||||
log(result.getMessage(), player, CheckType.NO_SWING);
|
||||
noHack = false;
|
||||
}
|
||||
if (getCheckManager().willCheck(player, CheckType.LONG_REACH)) {
|
||||
Distance distance = new Distance(player.getLocation(), block.getLocation());
|
||||
result = getBackend().checkLongReachBlock(player, distance.getXDifference(), distance.getYDifference(), distance.getZDifference());
|
||||
if (result.failed()) {
|
||||
event.setCancelled(!silentMode());
|
||||
log(result.getMessage(), player, CheckType.LONG_REACH);
|
||||
noHack = false;
|
||||
}
|
||||
}
|
||||
if (getCheckManager().willCheck(player, CheckType.LONG_REACH)) {
|
||||
Distance distance = new Distance(player.getLocation(), block.getLocation());
|
||||
result = getBackend().checkLongReachBlock(player, distance.getXDifference(), distance.getYDifference(), distance.getZDifference());
|
||||
if (result.failed()) {
|
||||
event.setCancelled(!silentMode());
|
||||
log(result.getMessage(), player, CheckType.LONG_REACH);
|
||||
noHack = false;
|
||||
}
|
||||
}
|
||||
if (getCheckManager().willCheck(player, CheckType.GHOSTHAND)) {
|
||||
result = GhosthandCheck.performCheck(player, event);
|
||||
if (result.failed()) {
|
||||
event.setCancelled(!silentMode());
|
||||
log(result.getMessage(), player, CheckType.GHOSTHAND);
|
||||
noHack = false;
|
||||
}
|
||||
}
|
||||
if (noHack) {
|
||||
|
||||
@@ -50,6 +50,8 @@ import org.bukkit.event.player.PlayerToggleFlightEvent;
|
||||
import org.bukkit.event.player.PlayerToggleSneakEvent;
|
||||
import org.bukkit.event.player.PlayerToggleSprintEvent;
|
||||
import org.bukkit.event.player.PlayerVelocityEvent;
|
||||
import org.bukkit.inventory.EquipmentSlot;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.inventory.PlayerInventory;
|
||||
|
||||
import com.rammelkast.anticheatreloaded.AntiCheatReloaded;
|
||||
@@ -243,11 +245,20 @@ public class PlayerListener extends EventListener {
|
||||
Player player = event.getPlayer();
|
||||
PlayerInventory inv = player.getInventory();
|
||||
if (event.getAction() == Action.RIGHT_CLICK_AIR || event.getAction() == Action.RIGHT_CLICK_BLOCK) {
|
||||
if (inv.getItemInMainHand().getType() == Material.BOW) {
|
||||
ItemStack itemInHand = ((event.getHand() == EquipmentSlot.HAND) ? inv.getItemInMainHand() : inv.getItemInOffHand());
|
||||
if (itemInHand.getType() == Material.BOW) {
|
||||
getBackend().logBowWindUp(player);
|
||||
} else if (Utilities.isFood(inv.getItemInMainHand().getType()) || Utilities.isFood(inv.getItemInOffHand().getType())) {
|
||||
} else if (Utilities.isFood(itemInHand.getType()) || Utilities.isFood(itemInHand.getType())) {
|
||||
getBackend().logEatingStart(player);
|
||||
}
|
||||
|
||||
if (itemInHand.getType() == Material.FIREWORK_ROCKET) {
|
||||
ElytraCheck.JUMP_Y_VALUE.remove(player.getUniqueId().toString());
|
||||
if (player.isGliding()) {
|
||||
// TODO config max elytra height?
|
||||
ElytraCheck.JUMP_Y_VALUE.put(player.getUniqueId().toString(), 9999.99D);
|
||||
}
|
||||
}
|
||||
}
|
||||
Block block = event.getClickedBlock();
|
||||
|
||||
@@ -297,17 +308,6 @@ public class PlayerListener extends EventListener {
|
||||
@EventHandler
|
||||
public void onPlayerJoin(PlayerJoinEvent event) {
|
||||
Player player = event.getPlayer();
|
||||
String section = "\u00a7";
|
||||
if (getCheckManager().willCheck(player, CheckType.ZOMBE_FLY)) {
|
||||
player.sendMessage(section + "f " + section + "f " + section + "1 " + section + "0 " + section + "2 " + section + "4");
|
||||
}
|
||||
if (getCheckManager().willCheck(player, CheckType.ZOMBE_CHEAT)) {
|
||||
player.sendMessage(section + "f " + section + "f " + section + "2 " + section + "0 " + section + "4 " + section + "8");
|
||||
}
|
||||
if (getCheckManager().willCheck(player, CheckType.ZOMBE_NOCLIP)) {
|
||||
player.sendMessage(section + "f " + section + "f " + section + "4 " + section + "0 " + section + "9 " + section + "6");
|
||||
}
|
||||
|
||||
getBackend().logJoin(player);
|
||||
|
||||
User user = new User(player.getUniqueId());
|
||||
@@ -366,10 +366,10 @@ public class PlayerListener extends EventListener {
|
||||
log(result.getMessage(), player, CheckType.FLIGHT);
|
||||
}
|
||||
}
|
||||
if (getCheckManager().willCheckQuick(player, CheckType.ELYTRA)) {
|
||||
if (getCheckManager().willCheckQuick(player, CheckType.ELYTRAFLY)) {
|
||||
CheckResult result = ElytraCheck.runCheck(player, distance);
|
||||
if (result.failed()) {
|
||||
log(result.getMessage(), player, CheckType.ELYTRA);
|
||||
log(result.getMessage(), player, CheckType.ELYTRAFLY);
|
||||
}
|
||||
}
|
||||
if (getCheckManager().willCheckQuick(player, CheckType.VCLIP) && event.getFrom().getY() > event.getTo().getY()) {
|
||||
|
||||
@@ -23,10 +23,10 @@ import org.bukkit.command.CommandSender;
|
||||
|
||||
public enum Permission {
|
||||
/* Check Nodes */
|
||||
CHECK_ZOMBE_FLY, CHECK_ZOMBE_NOCLIP, CHECK_ZOMBE_CHEAT, CHECK_FLIGHT, CHECK_ELYTRA, CHECK_WATERWALK, CHECK_NOSWING, CHECK_FASTBREAK,
|
||||
CHECK_FLIGHT, CHECK_ELYTRA, CHECK_WATERWALK, CHECK_NOSWING, CHECK_FASTBREAK,
|
||||
CHECK_FASTPLACE, CHECK_CHATSPAM, CHECK_COMMANDSPAM, CHECK_SPRINT, CHECK_SNEAK, CHECK_SPEED, CHECK_VCLIP,
|
||||
CHECK_SPIDER, CHECK_NOFALL, CHECK_FASTBOW, CHECK_FASTEAT, CHECK_FASTHEAL, CHECK_FORCEFIELD, CHECK_LONGREACH,
|
||||
CHECK_FASTPROJECTILE, CHECK_ITEMSPAM, CHECK_VISUAL, CHECK_FASTINVENTORY, CHECK_AUTOTOOL, CHECK_BLINK, CHECK_VELOCITY, CHECK_CRITICALS, CHECK_UNICODE,
|
||||
CHECK_SPIDER, CHECK_NOFALL, CHECK_FASTBOW, CHECK_FASTEAT, CHECK_FASTHEAL, CHECK_FORCEFIELD, CHECK_LONGREACH, CHECK_UNICODE,
|
||||
CHECK_FASTPROJECTILE, CHECK_ITEMSPAM, CHECK_VISUAL, CHECK_FASTINVENTORY, CHECK_AUTOTOOL, CHECK_BLINK, CHECK_VELOCITY, CHECK_CRITICALS, CHECK_GHOSTHAND,
|
||||
|
||||
/* System Nodes */
|
||||
SYSTEM_LOG, SYSTEM_RESET, SYSTEM_SPY, SYSTEM_HELP, SYSTEM_UPDATE, SYSTEM_REPORT, SYSTEM_ALERT, SYSTEM_NOTICE,
|
||||
|
||||
@@ -0,0 +1,158 @@
|
||||
/*
|
||||
* AntiCheatReloaded for Bukkit and Spigot.
|
||||
* Copyright (c) 2012-2015 AntiCheat Team
|
||||
* Copyright (c) 2016-2020 Rammelkast
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package com.rammelkast.anticheatreloaded.util;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.InputStreamReader;
|
||||
import java.net.URL;
|
||||
import java.nio.charset.Charset;
|
||||
|
||||
import com.rammelkast.anticheatreloaded.AntiCheatReloaded;
|
||||
|
||||
public class UpdateManager {
|
||||
|
||||
public static final int RESOURCE_ID = 23799;
|
||||
public static final String SPIGOT_VERSION_URL = "https://api.spigotmc.org/legacy/update.php?resource="
|
||||
+ RESOURCE_ID;
|
||||
|
||||
private final String latestVersion;
|
||||
private final boolean isLatest;
|
||||
|
||||
public UpdateManager() {
|
||||
this.latestVersion = this.getOnlineData(SPIGOT_VERSION_URL);
|
||||
if (this.latestVersion == null) {
|
||||
this.isLatest = true;
|
||||
return;
|
||||
}
|
||||
|
||||
int splitCompare = 0;
|
||||
try {
|
||||
VersionSplit currentSplit = new VersionSplit(AntiCheatReloaded.getVersion());
|
||||
VersionSplit newSplit = new VersionSplit(this.latestVersion);
|
||||
splitCompare = currentSplit.compareTo(newSplit);
|
||||
} catch (Exception e) {}
|
||||
this.isLatest = splitCompare >= 0;
|
||||
}
|
||||
|
||||
private String getOnlineData(String url) {
|
||||
String data = null;
|
||||
InputStream stream = null;
|
||||
try {
|
||||
stream = new URL(url).openStream();
|
||||
BufferedReader reader = new BufferedReader(new InputStreamReader(stream, Charset.forName("UTF-8")));
|
||||
StringBuilder builder = new StringBuilder();
|
||||
int readChar;
|
||||
while ((readChar = reader.read()) != -1) {
|
||||
builder.append((char) readChar);
|
||||
}
|
||||
data = builder.toString();
|
||||
} catch (IOException exception) {
|
||||
// TODO possibly handle this neatly?
|
||||
} finally {
|
||||
if (stream != null) {
|
||||
try {
|
||||
stream.close();
|
||||
} catch (IOException e) {
|
||||
}
|
||||
}
|
||||
}
|
||||
return data;
|
||||
}
|
||||
|
||||
public boolean isLatest() {
|
||||
return this.isLatest;
|
||||
}
|
||||
|
||||
public String getLatestVersion() {
|
||||
return this.latestVersion;
|
||||
}
|
||||
|
||||
public class VersionSplit implements Comparable<VersionSplit> {
|
||||
private final int major, sub, minor;
|
||||
|
||||
public VersionSplit(String version) throws Exception {
|
||||
if (version.endsWith("-ALPHA")) {
|
||||
version = version.substring(0, version.length() - 6);
|
||||
}
|
||||
|
||||
String[] versionSplit = version.split(".");
|
||||
if (versionSplit.length != 3) {
|
||||
// Illegal version
|
||||
throw new Exception("Illegal version!");
|
||||
}
|
||||
|
||||
try {
|
||||
int major = Integer.parseInt(versionSplit[0]);
|
||||
int sub = Integer.parseInt(versionSplit[1]);
|
||||
int minor = Integer.parseInt(versionSplit[2]);
|
||||
if (major <= 0) {
|
||||
throw new Exception("Illegal version!");
|
||||
}
|
||||
this.major = major;
|
||||
this.sub = sub;
|
||||
this.minor = minor;
|
||||
} catch (Exception e) {
|
||||
throw new Exception("Illegal version!");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int compareTo(VersionSplit other) {
|
||||
if (other.major > this.major) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (other.major < this.major) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (other.sub > this.sub) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (other.sub < this.sub) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (other.minor > this.minor) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (other.minor < this.minor) {
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
public int getMajor() {
|
||||
return major;
|
||||
}
|
||||
|
||||
public int getSub() {
|
||||
return sub;
|
||||
}
|
||||
|
||||
public int getMinor() {
|
||||
return minor;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -72,7 +72,7 @@ public final class Utilities {
|
||||
public static boolean cantStandAtSingle(Block block) {
|
||||
// TODO: Implement Better to reduce false positives (done? lets test...)
|
||||
Block otherBlock = block.getLocation().add(0, -0.5, 0).getBlock();
|
||||
boolean center = otherBlock.getType() == Material.AIR;
|
||||
boolean center = otherBlock.getType() == Material.AIR || otherBlock.getType() == Material.CAVE_AIR;
|
||||
return center;
|
||||
}
|
||||
|
||||
@@ -128,7 +128,7 @@ public final class Utilities {
|
||||
* @return true if the player can stand here
|
||||
*/
|
||||
public static boolean canStand(Block block) {
|
||||
return !(block.isLiquid() || block.getType() == Material.AIR);
|
||||
return !(block.isLiquid() || block.getType() == Material.AIR || block.getType() == Material.CAVE_AIR);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -181,7 +181,7 @@ public final class Utilities {
|
||||
public static boolean isHoveringOverWater(Location player, int blocks) {
|
||||
for (int i = player.getBlockY(); i > player.getBlockY() - blocks; i--) {
|
||||
Block newloc = (new Location(player.getWorld(), player.getBlockX(), i, player.getBlockZ())).getBlock();
|
||||
if (newloc.getType() != Material.AIR) {
|
||||
if (newloc.getType() != Material.AIR && newloc.getType() != Material.CAVE_AIR) {
|
||||
return newloc.isLiquid();
|
||||
}
|
||||
}
|
||||
@@ -417,7 +417,7 @@ public final class Utilities {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -434,7 +434,7 @@ public final class Utilities {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -74,5 +74,5 @@ public class VersionUtil {
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
+178
-21
@@ -1,91 +1,245 @@
|
||||
# AntiCheatReloaded configuration file
|
||||
#
|
||||
# This file is not yet fully documented
|
||||
# For more information on the undocumented values visit:
|
||||
# https://github.com/Rammelkast/AntiCheatReloaded/blob/master/src/main/java/com/rammelkast/anticheatreloaded/config/providers/Magic.java#L39-L380
|
||||
#
|
||||
# Maximum times a player can interact between animations
|
||||
# Changing this value of almost never required
|
||||
ANIMATION_INTERACT_MAX: 3
|
||||
# Minimum time between animations
|
||||
# Changing this value is almost never required
|
||||
ANIMATION_MIN: 200
|
||||
# Number of times a player can fail the ascension check before being considered a cheater
|
||||
# Increase in case of false positives
|
||||
ASCENSION_COUNT_MAX: 8
|
||||
# Minimum time in between block breaks
|
||||
# Decrease in case of false positives
|
||||
BLOCK_BREAK_MIN: 0.1
|
||||
# Maximum distance a player can break a block from
|
||||
# Changing this value is almost never required
|
||||
BLOCK_MAX_DISTANCE: 5.5
|
||||
# Maximum distance a player can break a block from when in creative mode
|
||||
# Changing this value is almost never required
|
||||
BLOCK_MAX_DISTANCE_CREATIVE: 6.0
|
||||
# Minimum time in between block placing
|
||||
# Decrease in case of false positives
|
||||
BLOCK_PLACE_MIN: 0.1
|
||||
# Number of times required to punch a block before it breaks
|
||||
# Changing this value is almost never required
|
||||
BLOCK_PUNCH_MIN: 5
|
||||
# Maximum percent error between predicted bow force and actual bow force
|
||||
# Increase in case of false positives
|
||||
BOW_ERROR: 0.25
|
||||
CHAT_ACTION_ONE_LEVEL: 3
|
||||
CHAT_ACTION_TWO_LEVEL: 5
|
||||
CHAT_MIN: 100
|
||||
CHAT_REPEAT_MIN: 260
|
||||
CHAT_WARN_LEVEL: 7
|
||||
COMMAND_ACTION_ONE_LEVEL: 3
|
||||
COMMAND_ACTION_TWO_LEVEL: 5
|
||||
COMMAND_MIN: 100
|
||||
COMMAND_REPEAT_MIN: 260
|
||||
# Number of chat spam violations before action one is executed
|
||||
# Should be changed to personal preference
|
||||
CHAT_ACTION_ONE_LEVEL: 5
|
||||
# Number of chat spam violations before action two is executed
|
||||
# Should be changed to personal preference
|
||||
CHAT_ACTION_TWO_LEVEL: 10
|
||||
# Minimum time between chats in milliseconds
|
||||
# Should be changed to personal preference
|
||||
CHAT_MIN: 500
|
||||
# Time before repeating yourself in chat is ignored in milliseconds
|
||||
# Should be changed to personal preference
|
||||
CHAT_REPEAT_MIN: 600
|
||||
# Number of command spam violations before action one is executed
|
||||
# Should be changed to personal preference
|
||||
COMMAND_ACTION_ONE_LEVEL: 5
|
||||
# Number of command spam violations before action two is executed
|
||||
# Should be changed to personal preference
|
||||
COMMAND_ACTION_TWO_LEVEL: 10
|
||||
# Minimum time between commands in milliseconds
|
||||
# Should be changed to personal preference
|
||||
COMMAND_MIN: 400
|
||||
# Time before repeating a command in milliseconds
|
||||
# Should be changed to personal preference
|
||||
COMMAND_REPEAT_MIN: 500
|
||||
# Time to exempt a player from moving because of taking damage
|
||||
# Can be decreased very slightly to increase detection
|
||||
# Increasing in case of false positives is almost never necessary and is not advised
|
||||
DAMAGE_TIME: 3000
|
||||
# Number of item drops to wait for before checking how long they took to drop
|
||||
# Changing this value is almost never required
|
||||
DROP_CHECK: 10
|
||||
# Minimum time it takes to drop X items
|
||||
# Changing this value is almost never required
|
||||
DROP_TIME_MIN: 800
|
||||
DROPPED_ITEM_TIME: 100
|
||||
# Minimum time in between eating
|
||||
# Decrease in case of false positives
|
||||
EAT_TIME_MIN: 1000
|
||||
# Time to exempt a player from moving because of entering/exiting a vehicle
|
||||
# Increase in case of false positives
|
||||
ENTERED_EXITED_TIME: 1000
|
||||
# Maximum distance a player can damage an entity from
|
||||
# Changing this value is almost never required
|
||||
ENTITY_MAX_DISTANCE: 5.9
|
||||
# Maximum distance a player can damage an entity from when in creative mode
|
||||
# Changing this value is almost never required
|
||||
ENTITY_MAX_DISTANCE_CREATIVE: 6.5
|
||||
# Time to exempt a player from moving because of exiting fly mode
|
||||
# Changing this value is almost never required
|
||||
EXIT_FLY_TIME: 2000
|
||||
# Time to exempt a player from moving because of taking damage from an explosion
|
||||
# Can be decreased very slightly to increase detection
|
||||
# Increasing in case of false positives is almost never necessary and is not advised
|
||||
EXPLOSION_DAMAGE_TIME: 5000
|
||||
# Max number of blocks that can be broken in a given time
|
||||
# Increase in case of false positives
|
||||
FASTBREAK_LIMIT: 2
|
||||
# Number of times fastbreak can be observed before considering a player a cheater
|
||||
# Can be increased in case of false positives, but shouldn't be required
|
||||
FASTBREAK_MAXVIOLATIONS: 2
|
||||
# Number of times fastbreak can be observed before considering a creative player a cheater
|
||||
# Can be increased in case of false positives, but shouldn't be required
|
||||
FASTBREAK_MAXVIOLATIONS_CREATIVE: 4
|
||||
# Time a player is forced to wait after fastbreak has been detected
|
||||
# Should be changed to personal preference
|
||||
FASTBREAK_MAXVIOLATIONTIME: 10000
|
||||
# Time to wait before checking block breaks
|
||||
# Increase in case of false positives
|
||||
FASTBREAK_TIMEMAX: 1000
|
||||
# Time to wait before checking block breaks for creative mode users
|
||||
# Increase in case of false positives
|
||||
FASTBREAK_TIMEMAX_CREATIVE: 100
|
||||
# Number of times fastplace can be observed before considering a player a cheater
|
||||
# Increase in case of false positives
|
||||
FASTPLACE_MAXVIOLATIONS: 2
|
||||
# Number of times fastplace can be observed before considering a creative player a cheater
|
||||
# Increase in case of false positives
|
||||
FASTPLACE_MAXVIOLATIONS_CREATIVE: 3
|
||||
# Time a player is forced to wait after fastplace has been detected
|
||||
# Should be changed to personal preference
|
||||
FASTPLACE_MAXVIOLATIONTIME: 10000
|
||||
# Minimum time in between block places
|
||||
# Decrease in case of false positives, but shouldn't be required
|
||||
FASTPLACE_TIMEMIN: 50
|
||||
# Number of blocks that can be broken without being hit before considering a player a cheater
|
||||
# Increase in case of false positives
|
||||
FASTPLACE_ZEROLIMIT: 3
|
||||
FLIGHT_BLOCK_LIMIT: 15.0
|
||||
FLIGHT_LIMIT: 150
|
||||
# How many blocks you can travel before being considered a cheater
|
||||
# Can be decreased to increase detection with the risk of false positives
|
||||
# Can be increased to decrease false positives, but shouldn't be necesary
|
||||
FLIGHT_BLOCK_LIMIT: 8.0
|
||||
# Time to exempt a player from fastbreak check because of using instant break
|
||||
# Increase in case of false positives, but shouldn't be necessary
|
||||
INSTANT_BREAK_TIME: 2
|
||||
# The number of clicks we should wait before checking if the player has used fast inventory
|
||||
# Increase in case of false positives
|
||||
INVENTORY_CHECK: 10
|
||||
# The minimum time it should have taken for the player to click X times
|
||||
# Increase in case of false positives
|
||||
INVENTORY_TIMEMIN: 50
|
||||
# Time to exempt a player from moving because of joining the server
|
||||
# If your server is slow when a player joins, increasing this value is important
|
||||
# Shouldn't be lower than 1500 or higher than 5000
|
||||
JOIN_TIME: 2000
|
||||
# Time to exempt a player from moving because of taking damage with knockback effects
|
||||
# Can be decreased very slightly to increase detection
|
||||
# Increase in case of false positives, but shouldn't be necessary
|
||||
KNOCKBACK_DAMAGE_TIME: 4000
|
||||
# Maximum speed a player on a ladder can travel
|
||||
# This is a set value and shouldn't be changed unless you know what you're doing
|
||||
LADDER_Y_MAX: 0.11761
|
||||
# Minimum speed a player on a ladder can travel
|
||||
# This is a set value and shouldn't be changed unless you know what you're doing
|
||||
LADDER_Y_MIN: 0.11759
|
||||
NOFALL_LIMIT: 9
|
||||
# Number of times a player can fail the nofall check before being considered a cheater
|
||||
# Can be decreased to improve detenction with the risk of false positives
|
||||
# Increase in case of false positives
|
||||
NOFALL_LIMIT: 8
|
||||
# Number of projectiles to wait for before checking how long they took to fire off
|
||||
# Do not decrease this value
|
||||
PROJECTILE_CHECK: 10
|
||||
# Minimum time it takes to fire X projectiles
|
||||
# Decrease in case of false positives
|
||||
PROJECTILE_TIME_MIN: 1500
|
||||
# Time to exempt a player from moving because of entering/exiting sneak mode
|
||||
# Increase in case of false positives, shouldn't be necessary
|
||||
SNEAK_TIME: 250
|
||||
# Maximum times a player can fail the speed check before being considered a cheater
|
||||
# Increase in case of false positives
|
||||
SPEED_MAX: 3
|
||||
# Number of times a player can sprint without proper food level before being considered a cheater
|
||||
# Can either be increased or decreased to your liking. Shouldn't make a massive difference.
|
||||
SPRINT_FOOD_MIN: 6
|
||||
SPRINT_MIN: 0.2
|
||||
# Maximum speed you can travel while sprinting
|
||||
# This is a set value and shouldn't be changed unless you know what you're doing
|
||||
SPRINT_MAX: 0.2
|
||||
# Minimum travel distance for move to be considered a teleport and subsequently be ignored
|
||||
# This is a set value and shouldn't be changed unless you know what you're doing
|
||||
TELEPORT_MIN: 400
|
||||
# Time to exempt a player from moving because of teleporting
|
||||
# Increase in case of false positives
|
||||
TELEPORT_TIME: 1000
|
||||
# The number of steps we should wait before checking if the player has used timer cheating
|
||||
# Increase in case of false positives
|
||||
TIMER_STEP_CHECK: 50
|
||||
# The minimum time it should have taken for the player to travel X steps
|
||||
# Decrease in case of false positives
|
||||
TIMER_TIMEMIN: 2000
|
||||
# Maximum time a player is considered to have a change in velocity
|
||||
# This is a set value and shouldn't be changed unless you know what you're doing
|
||||
VELOCITY_CHECKTIME: 2100
|
||||
# This is a set value and shouldn't be changed unless you know what you're doing
|
||||
VELOCITY_MAXTIMES: 2
|
||||
# This is a set value and shouldn't be changed unless you know what you're doing
|
||||
VELOCITY_PREVENT: 5000
|
||||
# This is a set value and shouldn't be changed unless you know what you're doing
|
||||
VELOCITY_SCHETIME: 2
|
||||
# This is a set value and shouldn't be changed unless you know what you're doing
|
||||
VELOCITY_TIME: 3
|
||||
WATER_ASCENSION_VIOLATION_MAX: 13
|
||||
# Number of times a player can fail the ascension check while in water before being considered a cheater
|
||||
# Increase in case of false positives
|
||||
WATER_ASCENSION_VIOLATION_MAX: 12
|
||||
# Maximum speed that a player can climb a waterfall
|
||||
# Can be increased in case of false positives, shouldn't be necesary
|
||||
WATER_CLIMB_MAX: 0.15
|
||||
# Number of times a player can be caught speeding in water before being considered a cheater
|
||||
# Increase in case of false positives
|
||||
WATER_SPEED_VIOLATION_MAX: 4
|
||||
# Maximum speed a player can travel forwards or backwards
|
||||
# This is a set value and shouldn't be changed unless you know what you're doing
|
||||
XZ_SPEED_MAX: 0.25
|
||||
# aximum speed a player can travel forwards or backwards while flying
|
||||
# This is a set value and shouldn't be changed unless you know what you're doing
|
||||
XZ_SPEED_MAX_FLY: 0.56
|
||||
# Maximum speed a player can travel forwards or backwards while under the influence
|
||||
# This is a set value and shouldn't be changed unless you know what you're doing
|
||||
XZ_SPEED_MAX_POTION: 0.7
|
||||
# Maximum speed a player can travel forwards or backwards while sprinting while under the influence
|
||||
# This is a set value and shouldn't be changed unless you know what you're doing
|
||||
XZ_SPEED_MAX_POTION_SPRINT: 0.95
|
||||
# Maximum speed a player can travel forwards or backwards while sneaking
|
||||
# This is a set value and shouldn't be changed unless you know what you're doing
|
||||
XZ_SPEED_MAX_SNEAK: 0.15
|
||||
# Maximum speed a player can travel forwards or backwards on soul sand
|
||||
# This is a set value and shouldn't be changed unless you know what you're doing
|
||||
XZ_SPEED_MAX_SOULSAND: 0.13
|
||||
# Maximum speed a player can travel forwards or backwards on soul sand while under the influenc
|
||||
# This is a set value and shouldn't be changed unless you know what you're doing
|
||||
XZ_SPEED_MAX_SOULSAND_POTION: 0.16
|
||||
# Maximum speed a player can travel forwards or backwards on soul sand while sprintin
|
||||
# This is a set value and shouldn't be changed unless you know what you're doing
|
||||
XZ_SPEED_MAX_SOULSAND_SPRINT: 0.2
|
||||
# Maximum speed a player can travel forwards or backwards while sprinting
|
||||
# This is a set value and shouldn't be changed unless you know what you're doing
|
||||
XZ_SPEED_MAX_SPRINT: 0.65
|
||||
# Maximum speed a player can travel forwards or backwards in water
|
||||
# This is a set value and shouldn't be changed unless you know what you're doing
|
||||
XZ_SPEED_MAX_WATER: 0.19
|
||||
# Maximum speed a player can travel forwards or backwards in water while sprinting
|
||||
# This is a set value and shouldn't be changed unless you know what you're doing
|
||||
XZ_SPEED_MAX_WATER_SPRINT: 0.3
|
||||
# Maximum difference between the player's last two Y values when traveling up
|
||||
# Can be decreased slightly to improve detection with the risk of false positives
|
||||
# Increase in case of false positives
|
||||
Y_MAXDIFF: 5.0
|
||||
# Number of times a player can fly on the y-axis before being considered a cheater
|
||||
# Increase in case of false positives
|
||||
Y_MAXVIOLATIONS: 1
|
||||
# Time a player is forced to wait after flyhacking on the y-axis
|
||||
# Should be changed to personal preference
|
||||
Y_MAXVIOTIME: 5500
|
||||
# Maximum speed a player can travel up
|
||||
# This is a set value and shouldn't be changed unless you know what you're doing
|
||||
Y_SPEED_MAX: 0.5175
|
||||
# Time in between Y difference measures
|
||||
# This is a set value and shouldn't be changed unless you know what you're doing
|
||||
Y_TIME: 800
|
||||
# Amount of suspicious mid-air movements before a player is suspected of glide
|
||||
# Increase this in case of false positives
|
||||
@@ -93,6 +247,9 @@ GLIDE_LIMIT: 10
|
||||
# Maximum amount of movement packets allowed per second
|
||||
# Increase this in case of false positives
|
||||
BLINK_PACKET: 25
|
||||
# If the blink check gives false positives replace this with the average user ping on your server
|
||||
# Not a good idea to use a value lower than 100 or higher than 200
|
||||
BLINK_AVERAGE_PING: 120
|
||||
# Maximum amount zero-velocity moments before a player is suspected
|
||||
# Increase this in case of false positives
|
||||
VELOCITY_AMT: 5
|
||||
@@ -52,20 +52,11 @@ permissions:
|
||||
anticheat.system.update: true
|
||||
anticheat.system.calibrate: true
|
||||
anticheat.system.debug: true
|
||||
anticheat.check.zombe.fly:
|
||||
description: Allow players to use zombe flymod
|
||||
default: false
|
||||
anticheat.check.zombe.noclip:
|
||||
description: Allow players to use zombe noclip hack
|
||||
default: false
|
||||
anticheat.check.zombe.cheat:
|
||||
description: Allow players to use zombe cheat hack
|
||||
default: false
|
||||
anticheat.check.flight:
|
||||
description: Allow players to fly
|
||||
description: Allow players to use fly cheats
|
||||
default: false
|
||||
anticheat.check.elytra:
|
||||
description: Allow players to fly when using elytra
|
||||
description: Allow players to use ElytraFly cheats
|
||||
default: false
|
||||
anticheat.check.waterwalk:
|
||||
description: Allow players to walk on water
|
||||
@@ -142,13 +133,13 @@ permissions:
|
||||
anticheat.check.unicode:
|
||||
description: Allow players to use unicode in chat
|
||||
default: false
|
||||
anticheat.check.ghosthand:
|
||||
description: Allow players to use ghosthand
|
||||
default: false
|
||||
anticheat.check.exempt:
|
||||
description: Total exemption from checks
|
||||
default: false
|
||||
children:
|
||||
anticheat.check.zombe.fly: true
|
||||
anticheat.check.zombe.noclip: true
|
||||
anticheat.check.zombe.cheat: true
|
||||
anticheat.check.fly: true
|
||||
anticheat.check.waterwalk: true
|
||||
anticheat.check.noswing: true
|
||||
@@ -175,4 +166,5 @@ permissions:
|
||||
anticheat.check.blink: true
|
||||
anticheat.check.velocity: true
|
||||
anticheat.check.criticals: true
|
||||
anticheat.check.unicode: true
|
||||
anticheat.check.unicode: true
|
||||
anticheat.check.ghosthand: true
|
||||
Reference in new issue
Block a user