Compare commits

...
3 Commits
Author SHA1 Message Date
Rammelkast acea36929b Nevermind 2020-02-28 12:57:24 +01:00
Rammelkast 8da9d7f365 Add Travis CI 2020-02-28 12:55:18 +01:00
Rammelkast c9c3b2397f Updated Metrics, made small code changes 2020-02-28 12:40:27 +01:00
18 changed files with 448 additions and 685 deletions

No files matched your search

-1
View File
@@ -1 +0,0 @@
acr.rammelkast.com
-1
View File
@@ -30,7 +30,6 @@ Hacks blocked
* Jesus * Jesus
* Step * Step
* Criticals * Criticals
* KillAura (not available on MC > 1.12.2
* Anti-Knockback * Anti-Knockback
* FastBow * FastBow
* FastDrop * FastDrop
-1
View File
@@ -1 +0,0 @@
theme: jekyll-theme-cayman
+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.7.0-ALPHA</version> <version>1.7.1-ALPHA</version>
<name>AntiCheatReloaded</name> <name>AntiCheatReloaded</name>
<url>https://rammelkast.com</url> <url>https://rammelkast.com</url>
<properties> <properties>
@@ -23,6 +23,7 @@ import java.security.SecureRandom;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.UUID; import java.util.UUID;
import java.util.concurrent.Callable;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.ChatColor; import org.bukkit.ChatColor;
@@ -32,7 +33,6 @@ import org.bukkit.plugin.java.JavaPlugin;
import com.comphenix.protocol.ProtocolLibrary; import com.comphenix.protocol.ProtocolLibrary;
import com.comphenix.protocol.ProtocolManager; import com.comphenix.protocol.ProtocolManager;
import com.rammelkast.anticheatreloaded.check.combat.KillAuraCheck;
import com.rammelkast.anticheatreloaded.check.movement.BlinkCheck; import com.rammelkast.anticheatreloaded.check.movement.BlinkCheck;
import com.rammelkast.anticheatreloaded.command.CommandHandler; import com.rammelkast.anticheatreloaded.command.CommandHandler;
import com.rammelkast.anticheatreloaded.config.Configuration; import com.rammelkast.anticheatreloaded.config.Configuration;
@@ -92,7 +92,6 @@ public class AntiCheatReloaded extends JavaPlugin {
} }
getLogger().info("Found ProtocolLib, enabling checks that use ProtcolLib..."); getLogger().info("Found ProtocolLib, enabling checks that use ProtcolLib...");
// Enable packetlisteners // Enable packetlisteners
KillAuraCheck.listenPackets();
BlinkCheck.startTimer(); BlinkCheck.startTimer();
BlinkCheck.listenPackets(); BlinkCheck.listenPackets();
@@ -149,46 +148,38 @@ public class AntiCheatReloaded extends JavaPlugin {
// Metrics // Metrics
try { try {
Metrics metrics = new Metrics(this); Metrics metrics = new Metrics(this, 202);
metrics.addCustomChart(new Metrics.SingleLineChart("cheaters_kicked") { metrics.addCustomChart(new Metrics.SingleLineChart("cheaters_kicked", new Callable<Integer>() {
@Override @Override
public int getValue() { public Integer call() throws Exception {
int kicked = playersKicked; int kicked = playersKicked;
// Reset so we don't keep sending the same value // Reset so we don't keep sending the same value
playersKicked = 0; playersKicked = 0;
return kicked; return kicked;
} }
}); }));
metrics.addCustomChart(new Metrics.SingleLineChart("killaura_violations") { metrics.addCustomChart(new Metrics.SingleLineChart("glide_violations", new Callable<Integer>() {
@Override @Override
public int getValue() { public Integer call() throws Exception {
int violations = killauraViolations;
// Reset so we don't keep sending the same value
killauraViolations = 0;
return violations;
}
});
metrics.addCustomChart(new Metrics.SingleLineChart("glide_violations") {
@Override
public int getValue() {
int violations = glideViolations; int violations = glideViolations;
// Reset so we don't keep sending the same value // Reset so we don't keep sending the same value
glideViolations = 0; glideViolations = 0;
return violations; return violations;
} }
}); }));
metrics.addCustomChart(new Metrics.SimplePie("protocollib_version") { metrics.addCustomChart(new Metrics.SimplePie("protocollib_version", new Callable<String>() {
@Override @Override
public String getValue() { public String call() throws Exception {
return Bukkit.getPluginManager().getPlugin("ProtocolLib").getDescription().getVersion(); return Bukkit.getPluginManager().getPlugin("ProtocolLib").getDescription().getVersion();
} }
}); }));
metrics.addCustomChart(new Metrics.SimplePie("nms_version") { metrics.addCustomChart(new Metrics.SimplePie("nms_version", new Callable<String>() {
@Override @Override
public String getValue() { public String call() throws Exception {
return VersionUtil.getVersion(); return VersionUtil.getVersion();
} }
});
}));
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
} }
@@ -309,10 +300,6 @@ public class AntiCheatReloaded extends JavaPlugin {
* Amount of players kicked since start * Amount of players kicked since start
*/ */
private int playersKicked = 0; private int playersKicked = 0;
/**
* Amount of killaura violations since start
*/
private int killauraViolations = 0;
/** /**
* Amount of glide violations since start * Amount of glide violations since start
*/ */
@@ -322,10 +309,6 @@ public class AntiCheatReloaded extends JavaPlugin {
this.playersKicked++; this.playersKicked++;
} }
public void onKillAuraViolation() {
this.killauraViolations++;
}
public void onGlideViolation() { public void onGlideViolation() {
this.glideViolations++; this.glideViolations++;
} }
@@ -39,7 +39,6 @@ import org.bukkit.event.player.PlayerToggleSprintEvent;
import org.bukkit.potion.PotionEffectType; import org.bukkit.potion.PotionEffectType;
import com.rammelkast.anticheatreloaded.AntiCheatReloaded; import com.rammelkast.anticheatreloaded.AntiCheatReloaded;
import com.rammelkast.anticheatreloaded.check.combat.KillAuraCheck;
import com.rammelkast.anticheatreloaded.check.combat.VelocityCheck; import com.rammelkast.anticheatreloaded.check.combat.VelocityCheck;
import com.rammelkast.anticheatreloaded.check.movement.BlinkCheck; import com.rammelkast.anticheatreloaded.check.movement.BlinkCheck;
import com.rammelkast.anticheatreloaded.check.movement.FlightCheck; import com.rammelkast.anticheatreloaded.check.movement.FlightCheck;
@@ -121,29 +120,28 @@ public class Backend {
UUID pU = player.getUniqueId(); UUID pU = player.getUniqueId();
VelocityCheck.cleanPlayer(player); VelocityCheck.cleanPlayer(player);
KillAuraCheck.cleanPlayer(player);
BlinkCheck.MOVE_COUNT.remove(player.getUniqueId()); BlinkCheck.MOVE_COUNT.remove(player.getUniqueId());
blocksDropped.remove(pU); blocksDropped.remove(pU);
blockTime.remove(pU); blockTime.remove(pU);
FlightCheck.movingExempt.remove(pU); FlightCheck.MOVING_EXEMPT.remove(pU);
brokenBlock.remove(pU); brokenBlock.remove(pU);
placedBlock.remove(pU); placedBlock.remove(pU);
bowWindUp.remove(pU); bowWindUp.remove(pU);
startEat.remove(pU); startEat.remove(pU);
lastHeal.remove(pU); lastHeal.remove(pU);
sprinted.remove(pU); sprinted.remove(pU);
WaterWalkCheck.isInWater.remove(pU); WaterWalkCheck.IS_IN_WATER.remove(pU);
WaterWalkCheck.isInWaterCache.remove(pU); WaterWalkCheck.IS_IN_WATER_CACHE.remove(pU);
instantBreakExempt.remove(pU); instantBreakExempt.remove(pU);
isAscending.remove(player.getUniqueId()); isAscending.remove(player.getUniqueId());
ascensionCount.remove(player.getUniqueId()); ascensionCount.remove(player.getUniqueId());
FlightCheck.blocksOverFlight.remove(pU); FlightCheck.BLOCKS_OVER_FLIGHT.remove(pU);
nofallViolation.remove(pU); nofallViolation.remove(pU);
fastBreakViolation.remove(pU); fastBreakViolation.remove(pU);
YAxisCheck.yAxisViolations.remove(pU); YAxisCheck.Y_AXIS_VIOLATIONS.remove(pU);
YAxisCheck.yAxisLastViolation.remove(pU); YAxisCheck.LAST_Y_AXIS_VIOLATION.remove(pU);
YAxisCheck.lastYcoord.remove(pU); YAxisCheck.LAST_Y_COORD_CACHE.remove(pU);
YAxisCheck.lastYtime.remove(pU); YAxisCheck.LAST_Y_TIME.remove(pU);
fastBreaks.remove(pU); fastBreaks.remove(pU);
blockBreakHolder.remove(pU); blockBreakHolder.remove(pU);
lastBlockBroken.remove(pU); lastBlockBroken.remove(pU);
@@ -151,8 +149,8 @@ public class Backend {
lastBlockPlaced.remove(pU); lastBlockPlaced.remove(pU);
lastBlockPlaceTime.remove(pU); lastBlockPlaceTime.remove(pU);
blockPunches.remove(pU); blockPunches.remove(pU);
WaterWalkCheck.waterAscensionViolation.remove(pU); WaterWalkCheck.WATER_ASCENSION_VIOLATIONS.remove(pU);
WaterWalkCheck.waterSpeedViolation.remove(pU); WaterWalkCheck.WATER_SPEED_VIOLATIONS.remove(pU);
projectilesShot.remove(pU); projectilesShot.remove(pU);
velocitized.remove(pU); velocitized.remove(pU);
velocitytrack.remove(pU); velocitytrack.remove(pU);
@@ -164,17 +162,17 @@ public class Backend {
sprinted.remove(pU); sprinted.remove(pU);
brokenBlock.remove(pU); brokenBlock.remove(pU);
placedBlock.remove(pU); placedBlock.remove(pU);
FlightCheck.movingExempt.remove(pU); FlightCheck.MOVING_EXEMPT.remove(pU);
blockTime.remove(pU); blockTime.remove(pU);
blocksDropped.remove(pU); blocksDropped.remove(pU);
lastInventoryTime.remove(pU); lastInventoryTime.remove(pU);
inventoryTime.remove(pU); inventoryTime.remove(pU);
inventoryClicks.remove(pU); inventoryClicks.remove(pU);
lastFallPacket.remove(pU); lastFallPacket.remove(pU);
GlideCheck.lastDiff.remove(pU); GlideCheck.LAST_DIFFERENCE.remove(pU);
GlideCheck.lastFallDistance.remove(pU); GlideCheck.LAST_FALL_DISTANCE.remove(pU);
GlideCheck.violations.remove(pU); GlideCheck.VIOLATIONS.remove(pU);
SpeedCheck.speedViolation.remove(player.getUniqueId()); SpeedCheck.SPEED_VIOLATIONS.remove(player.getUniqueId());
} }
public CheckResult checkFastBow(Player player, float force) { public CheckResult checkFastBow(Player player, float force) {
@@ -703,8 +701,8 @@ public class Backend {
} }
public boolean isHoveringOverWaterAfterViolation(Player player) { public boolean isHoveringOverWaterAfterViolation(Player player) {
if (WaterWalkCheck.waterSpeedViolation.containsKey(player.getUniqueId())) { if (WaterWalkCheck.WATER_SPEED_VIOLATIONS.containsKey(player.getUniqueId())) {
if (WaterWalkCheck.waterSpeedViolation.get(player.getUniqueId()) >= magic.WATER_SPEED_VIOLATION_MAX() && Utilities.isHoveringOverWater(player.getLocation())) { if (WaterWalkCheck.WATER_SPEED_VIOLATIONS.get(player.getUniqueId()) >= magic.WATER_SPEED_VIOLATION_MAX() && Utilities.isHoveringOverWater(player.getLocation())) {
return true; return true;
} }
} }
@@ -771,43 +769,43 @@ public class Backend {
break; break;
} }
FlightCheck.movingExempt.put(player.getUniqueId(), System.currentTimeMillis() + time); FlightCheck.MOVING_EXEMPT.put(player.getUniqueId(), System.currentTimeMillis() + time);
// Only map in which termination time is calculated beforehand. // Only map in which termination time is calculated beforehand.
} }
public void logEnterExit(final Player player) { public void logEnterExit(final Player player) {
FlightCheck.movingExempt.put(player.getUniqueId(), System.currentTimeMillis() + magic.ENTERED_EXITED_TIME()); FlightCheck.MOVING_EXEMPT.put(player.getUniqueId(), System.currentTimeMillis() + magic.ENTERED_EXITED_TIME());
} }
public void logToggleSneak(final Player player) { public void logToggleSneak(final Player player) {
FlightCheck.movingExempt.put(player.getUniqueId(), System.currentTimeMillis() + magic.SNEAK_TIME()); FlightCheck.MOVING_EXEMPT.put(player.getUniqueId(), System.currentTimeMillis() + magic.SNEAK_TIME());
} }
public void logTeleport(final Player player) { public void logTeleport(final Player player) {
FlightCheck.movingExempt.put(player.getUniqueId(), System.currentTimeMillis() + magic.TELEPORT_TIME()); FlightCheck.MOVING_EXEMPT.put(player.getUniqueId(), System.currentTimeMillis() + magic.TELEPORT_TIME());
/* Data for fly/speed should be reset */ /* Data for fly/speed should be reset */
nofallViolation.remove(player.getUniqueId()); nofallViolation.remove(player.getUniqueId());
FlightCheck.blocksOverFlight.remove(player.getUniqueId()); FlightCheck.BLOCKS_OVER_FLIGHT.remove(player.getUniqueId());
YAxisCheck.yAxisViolations.remove(player.getUniqueId()); YAxisCheck.Y_AXIS_VIOLATIONS.remove(player.getUniqueId());
YAxisCheck.yAxisLastViolation.remove(player.getUniqueId()); YAxisCheck.LAST_Y_AXIS_VIOLATION.remove(player.getUniqueId());
YAxisCheck.lastYcoord.remove(player.getUniqueId()); YAxisCheck.LAST_Y_COORD_CACHE.remove(player.getUniqueId());
YAxisCheck.lastYtime.remove(player.getUniqueId()); YAxisCheck.LAST_Y_TIME.remove(player.getUniqueId());
GlideCheck.lastFallDistance.remove(player.getUniqueId()); GlideCheck.LAST_FALL_DISTANCE.remove(player.getUniqueId());
GlideCheck.lastDiff.remove(player.getUniqueId()); GlideCheck.LAST_DIFFERENCE.remove(player.getUniqueId());
GlideCheck.violations.remove(player.getUniqueId()); GlideCheck.VIOLATIONS.remove(player.getUniqueId());
} }
public void logExitFly(final Player player) { public void logExitFly(final Player player) {
FlightCheck.movingExempt.put(player.getUniqueId(), System.currentTimeMillis() + magic.EXIT_FLY_TIME()); FlightCheck.MOVING_EXEMPT.put(player.getUniqueId(), System.currentTimeMillis() + magic.EXIT_FLY_TIME());
} }
public void logJoin(final Player player) { public void logJoin(final Player player) {
FlightCheck.movingExempt.put(player.getUniqueId(), System.currentTimeMillis() + magic.JOIN_TIME()); FlightCheck.MOVING_EXEMPT.put(player.getUniqueId(), System.currentTimeMillis() + magic.JOIN_TIME());
} }
public boolean isMovingExempt(Player player) { public boolean isMovingExempt(Player player) {
return isDoing(player, FlightCheck.movingExempt, -1); return isDoing(player, FlightCheck.MOVING_EXEMPT, -1);
} }
public boolean isAscending(Player player) { public boolean isAscending(Player player) {
@@ -62,7 +62,6 @@ public enum CheckType {
ITEM_SPAM(Permission.CHECK_ITEMSPAM), ITEM_SPAM(Permission.CHECK_ITEMSPAM),
FAST_INVENTORY(Permission.CHECK_FASTINVENTORY), FAST_INVENTORY(Permission.CHECK_FASTINVENTORY),
AUTOTOOL(Permission.CHECK_AUTOTOOL), AUTOTOOL(Permission.CHECK_AUTOTOOL),
KILLAURA(Permission.CHECK_KILLAURA),
BLINK(Permission.CHECK_BLINK), BLINK(Permission.CHECK_BLINK),
VELOCITY(Permission.CHECK_VELOCITY), VELOCITY(Permission.CHECK_VELOCITY),
CRITICALS(Permission.CHECK_CRITICALS), CRITICALS(Permission.CHECK_CRITICALS),
@@ -1,100 +0,0 @@
/*
* 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.check.combat;
import org.bukkit.entity.Player;
import org.bukkit.event.entity.EntityDamageByEntityEvent;
import org.bukkit.event.player.PlayerMoveEvent;
/**
* @author Rammelkast
*/
@Deprecated
public class KillAuraCheck {
//private static final Map<UUID, NPC_1_12> NPC_LIST = new HashMap<UUID, NPC_1_12>();
//private static final Map<UUID, Integer> VL_COUNT = new HashMap<UUID, Integer>();
public static void cleanPlayer(Player p) {
/*if (!VersionUtil.getVersion().equals("v1_12_R1")) {
return;
}
NPC_LIST.remove(p.getUniqueId());*/
}
public static void listenPackets() {
/*if (!VersionUtil.getVersion().equals("v1_12_R1")) {
return;
}
AntiCheatReloaded.getProtocolManager().addPacketListener(new PacketAdapter(AntiCheatReloaded.getPlugin(),
ListenerPriority.NORMAL, new PacketType[] { PacketType.Play.Client.USE_ENTITY }) {
@Override
public void onPacketReceiving(PacketEvent e) {
Player p = e.getPlayer();
if (!NPC_LIST.containsKey(p.getUniqueId()))
return;
int id = e.getPacket().getIntegers().read(0);
if (NPC_LIST.containsKey(p.getUniqueId())) {
if (NPC_LIST.get(p.getUniqueId()).getID() != id) {
return;
}
}
if (!VL_COUNT.containsKey(p.getUniqueId())) {
VL_COUNT.put(p.getUniqueId(), 1);
NPC_LIST.get(p.getUniqueId()).damage();
} else {
VL_COUNT.put(p.getUniqueId(), VL_COUNT.get(p.getUniqueId()) + 1);
if (VL_COUNT.get(p.getUniqueId()) >= 5) {
EventListener.log(
new CheckResult(CheckResult.Result.FAILED,
p.getName() + " failed KillAura (botcheck), hit the bot "
+ VL_COUNT.get(p.getUniqueId()) + " times (max=5)").getMessage(),
p, CheckType.KILLAURA);
AntiCheatReloaded.getPlugin().onKillAuraViolation();
VL_COUNT.remove(p.getUniqueId());
}
}
}
});*/
}
public static void doDamageEvent(EntityDamageByEntityEvent e, Player p) {
/*if (!VersionUtil.getVersion().equals("v1_12_R1")) {
return;
}
if (NPC_LIST.containsKey(p.getUniqueId()))
NPC_LIST.get(p.getUniqueId()).damage(e, p);
else {
NPC_1_12 npc = new NPC_1_12(p);
NPC_LIST.put(p.getUniqueId(), npc);
npc.spawn();
}*/
}
public static void doMove(PlayerMoveEvent e) {
/*if (!VersionUtil.getVersion().equals("v1_12_R1")) {
return;
}
if (NPC_LIST.containsKey(e.getPlayer().getUniqueId())) {
NPC_LIST.get(e.getPlayer().getUniqueId()).move(e);
}*/
}
}
@@ -51,7 +51,7 @@ public class BlinkCheck {
public void run() { public void run() {
MOVE_COUNT.clear(); MOVE_COUNT.clear();
} }
}.runTaskTimer(AntiCheatReloaded.getPlugin(), 100, 20); }.runTaskTimer(AntiCheatReloaded.getPlugin(), 20, 20);
} }
public static void listenPackets() { public static void listenPackets() {
@@ -38,11 +38,10 @@ import com.rammelkast.anticheatreloaded.util.VersionUtil;
*/ */
public class FlightCheck { public class FlightCheck {
public static final Map<UUID, Double> BLOCKS_OVER_FLIGHT = new HashMap<UUID, Double>();
public static final Map<UUID, Long> MOVING_EXEMPT = new HashMap<UUID, Long>();
private static final CheckResult PASS = new CheckResult(CheckResult.Result.PASSED); private static final CheckResult PASS = new CheckResult(CheckResult.Result.PASSED);
public static Map<UUID, Double> blocksOverFlight = new HashMap<UUID, Double>();
public static Map<UUID, Long> movingExempt = new HashMap<UUID, Long>();
public static CheckResult runCheck(Player player, Distance distance) { public static CheckResult runCheck(Player player, Distance distance) {
if (distance.getYDifference() > AntiCheatReloaded.getManager().getBackend().getMagic().TELEPORT_MIN() if (distance.getYDifference() > AntiCheatReloaded.getManager().getBackend().getMagic().TELEPORT_MIN()
|| VersionUtil.isFlying(player)) { || VersionUtil.isFlying(player)) {
@@ -62,32 +61,32 @@ public class FlightCheck {
"FENCE_GATE" "FENCE_GATE"
})) { })) {
if (!blocksOverFlight.containsKey(uuid)) { if (!BLOCKS_OVER_FLIGHT.containsKey(uuid)) {
blocksOverFlight.put(uuid, 0D); BLOCKS_OVER_FLIGHT.put(uuid, 0D);
} }
blocksOverFlight.put(uuid, (blocksOverFlight.get(uuid) + distance.getXDifference() BLOCKS_OVER_FLIGHT.put(uuid, (BLOCKS_OVER_FLIGHT.get(uuid) + distance.getXDifference()
+ distance.getYDifference() + distance.getZDifference())); + distance.getYDifference() + distance.getZDifference()));
if (y1 > y2) { if (y1 > y2) {
blocksOverFlight.put(uuid, (blocksOverFlight.get(uuid) - distance.getYDifference())); BLOCKS_OVER_FLIGHT.put(uuid, (BLOCKS_OVER_FLIGHT.get(uuid) - distance.getYDifference()));
} }
if (blocksOverFlight.get(uuid) > AntiCheatReloaded.getManager().getBackend().getMagic().FLIGHT_BLOCK_LIMIT() if (BLOCKS_OVER_FLIGHT.get(uuid) > AntiCheatReloaded.getManager().getBackend().getMagic().FLIGHT_BLOCK_LIMIT()
&& (y1 <= y2)) { && (y1 <= y2)) {
return new CheckResult(CheckResult.Result.FAILED, return new CheckResult(CheckResult.Result.FAILED,
player.getName() + " flew over " + blocksOverFlight.get(uuid) + " blocks (max=" player.getName() + " flew over " + BLOCKS_OVER_FLIGHT.get(uuid) + " blocks (max="
+ AntiCheatReloaded.getManager().getBackend().getMagic().FLIGHT_BLOCK_LIMIT() + ")"); + AntiCheatReloaded.getManager().getBackend().getMagic().FLIGHT_BLOCK_LIMIT() + ")");
} }
} else { } else {
blocksOverFlight.put(uuid, 0D); BLOCKS_OVER_FLIGHT.put(uuid, 0D);
} }
return PASS; return PASS;
} }
public static boolean isMovingExempt(Player player) { public static boolean isMovingExempt(Player player) {
return isDoing(player, movingExempt, -1); return isDoing(player, MOVING_EXEMPT, -1);
} }
private static boolean isDoing(Player player, Map<UUID, Long> map, double max) { private static boolean isDoing(Player player, Map<UUID, Long> map, double max) {
@@ -20,6 +20,7 @@
package com.rammelkast.anticheatreloaded.check.movement; package com.rammelkast.anticheatreloaded.check.movement;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map; import java.util.Map;
import java.util.UUID; import java.util.UUID;
@@ -35,36 +36,37 @@ import com.rammelkast.anticheatreloaded.util.VersionUtil;
public class GlideCheck { public class GlideCheck {
public static final Map<UUID, Double> LAST_DIFFERENCE = new HashMap<UUID, Double>();
public static final Map<UUID, Float> LAST_FALL_DISTANCE = new HashMap<UUID, Float>();
public static final Map<UUID, Integer> VIOLATIONS = new HashMap<UUID, Integer>();
private static final CheckResult PASS = new CheckResult(CheckResult.Result.PASSED); private static final CheckResult PASS = new CheckResult(CheckResult.Result.PASSED);
public static Map<UUID, Double> lastDiff = new HashMap<UUID, Double>();
public static Map<UUID, Float> lastFallDistance = new HashMap<UUID, Float>();
public static Map<UUID, Integer> violations = new HashMap<UUID, Integer>();
public static CheckResult runCheck(Player player, Distance distance) { public static CheckResult runCheck(Player player, Distance distance) {
if (VersionUtil.isFlying(player)) { if (VersionUtil.isFlying(player)) {
return PASS; return PASS;
} }
if (player.getLocation().getBlock().getType() == Material.LADDER || player.getLocation().getBlock().getRelative(0, 1, 0).getType() == Material.LADDER) { if (player.getLocation().getBlock().getType() == Material.LADDER
|| player.getLocation().getBlock().getRelative(0, 1, 0).getType() == Material.LADDER) {
return PASS; return PASS;
} }
if (!lastDiff.containsKey(player.getUniqueId())) { if (!LAST_DIFFERENCE.containsKey(player.getUniqueId())) {
lastDiff.put(player.getUniqueId(), distance.getYDifference()); LAST_DIFFERENCE.put(player.getUniqueId(), distance.getYDifference());
return PASS; return PASS;
} }
if (!lastFallDistance.containsKey(player.getUniqueId())) { if (!LAST_FALL_DISTANCE.containsKey(player.getUniqueId())) {
lastFallDistance.put(player.getUniqueId(), player.getFallDistance()); LAST_FALL_DISTANCE.put(player.getUniqueId(), player.getFallDistance());
return PASS; return PASS;
} }
double yDiff = distance.getYDifference(); double yDiff = distance.getYDifference();
float fallDistance = player.getFallDistance(); float fallDistance = player.getFallDistance();
if (yDiff == lastDiff.get(player.getUniqueId()) && fallDistance > lastFallDistance.get(player.getUniqueId())) { if (yDiff == LAST_DIFFERENCE.get(player.getUniqueId())
if (!violations.containsKey(player.getUniqueId())) { && fallDistance > LAST_FALL_DISTANCE.get(player.getUniqueId())) {
violations.put(player.getUniqueId(), 1); if (!VIOLATIONS.containsKey(player.getUniqueId())) {
VIOLATIONS.put(player.getUniqueId(), 1);
} else { } else {
if (violations.get(player.getUniqueId()) + 1 >= AntiCheatReloaded.getManager().getBackend().getMagic() if (VIOLATIONS.get(player.getUniqueId()) + 1 >= AntiCheatReloaded.getManager().getBackend().getMagic()
.GLIDE_LIMIT()) { .GLIDE_LIMIT()) {
violations.remove(player.getUniqueId()); VIOLATIONS.remove(player.getUniqueId());
Location to = player.getLocation(); Location to = player.getLocation();
to.setY(to.getY() - distanceToFall(to)); to.setY(to.getY() - distanceToFall(to));
player.teleport(to); player.teleport(to);
@@ -72,16 +74,16 @@ public class GlideCheck {
AntiCheatReloaded.getPlugin().onGlideViolation(); AntiCheatReloaded.getPlugin().onGlideViolation();
return new CheckResult(CheckResult.Result.FAILED, return new CheckResult(CheckResult.Result.FAILED,
player.getName() + " was set back for gliding (yDiff=" player.getName() + " was set back for gliding (yDiff="
+ new BigDecimal(yDiff).setScale(2, BigDecimal.ROUND_UP) + ")"); + new BigDecimal(yDiff).setScale(2, RoundingMode.HALF_UP) + ")");
} else { } else {
violations.put(player.getUniqueId(), violations.get(player.getUniqueId()) + 1); VIOLATIONS.put(player.getUniqueId(), VIOLATIONS.get(player.getUniqueId()) + 1);
} }
} }
} else { } else {
// TODO more sophisticated check // TODO more sophisticated check
} }
lastDiff.put(player.getUniqueId(), distance.getYDifference()); LAST_DIFFERENCE.put(player.getUniqueId(), distance.getYDifference());
lastFallDistance.put(player.getUniqueId(), player.getFallDistance()); LAST_FALL_DISTANCE.put(player.getUniqueId(), player.getFallDistance());
return PASS; return PASS;
} }
@@ -32,8 +32,8 @@ import com.rammelkast.anticheatreloaded.util.VersionUtil;
public class SpeedCheck { public class SpeedCheck {
public static final Map<UUID, Integer> SPEED_VIOLATIONS = new HashMap<UUID, Integer>();
private static final CheckResult PASS = new CheckResult(CheckResult.Result.PASSED); private static final CheckResult PASS = new CheckResult(CheckResult.Result.PASSED);
public static Map<UUID, Integer> speedViolation = new HashMap<UUID, Integer>();
public static boolean isSpeedExempt(Player player) { public static boolean isSpeedExempt(Player player) {
return AntiCheatReloaded.getManager().getBackend().isMovingExempt(player) return AntiCheatReloaded.getManager().getBackend().isMovingExempt(player)
@@ -75,7 +75,7 @@ public class SpeedCheck {
max += speed > 0 ? player.getWalkSpeed() - 0.2f : 0; max += speed > 0 ? player.getWalkSpeed() - 0.2f : 0;
if (x > max || z > max) { if (x > max || z > max) {
int num = AntiCheatReloaded.getManager().getBackend().increment(player, speedViolation, int num = AntiCheatReloaded.getManager().getBackend().increment(player, SPEED_VIOLATIONS,
AntiCheatReloaded.getManager().getBackend().getMagic().SPEED_MAX()); AntiCheatReloaded.getManager().getBackend().getMagic().SPEED_MAX());
if (num >= AntiCheatReloaded.getManager().getBackend().getMagic().SPEED_MAX()) { if (num >= AntiCheatReloaded.getManager().getBackend().getMagic().SPEED_MAX()) {
return new CheckResult(CheckResult.Result.FAILED, return new CheckResult(CheckResult.Result.FAILED,
@@ -86,7 +86,7 @@ public class SpeedCheck {
return PASS; return PASS;
} }
} else { } else {
speedViolation.put(player.getUniqueId(), 0); SPEED_VIOLATIONS.put(player.getUniqueId(), 0);
return PASS; return PASS;
} }
} else { } else {
@@ -40,21 +40,20 @@ import com.rammelkast.anticheatreloaded.util.VersionUtil;
*/ */
public class WaterWalkCheck { public class WaterWalkCheck {
public static final List<UUID> IS_IN_WATER = new ArrayList<UUID>();
public static final List<UUID> IS_IN_WATER_CACHE = new ArrayList<UUID>();
public static final Map<UUID, Integer> WATER_SPEED_VIOLATIONS = new HashMap<UUID, Integer>();
public static final Map<UUID, Integer> WATER_ASCENSION_VIOLATIONS = new HashMap<UUID, Integer>();
private static final CheckResult PASS = new CheckResult(CheckResult.Result.PASSED); private static final CheckResult PASS = new CheckResult(CheckResult.Result.PASSED);
public static List<UUID> isInWater = new ArrayList<UUID>();
public static List<UUID> isInWaterCache = new ArrayList<UUID>();
public static Map<UUID, Integer> waterSpeedViolation = new HashMap<UUID, Integer>();
public static Map<UUID, Integer> waterAscensionViolation = new HashMap<UUID, Integer>();
public static CheckResult runCheck(Player player, double x, double y, double z) { public static CheckResult runCheck(Player player, double x, double y, double z) {
Block block = player.getLocation().getBlock(); Block block = player.getLocation().getBlock();
UUID uuid = player.getUniqueId(); UUID uuid = player.getUniqueId();
if (player.getVehicle() == null && !player.isFlying() && !VersionUtil.isFrostWalk(player)) { if (player.getVehicle() == null && !player.isFlying() && !VersionUtil.isFrostWalk(player)) {
if (block.isLiquid()) { if (block.isLiquid()) {
if (isInWater.contains(uuid)) { if (IS_IN_WATER.contains(uuid)) {
if (isInWaterCache.contains(uuid)) { if (IS_IN_WATER_CACHE.contains(uuid)) {
if (player.getNearbyEntities(1, 1, 1).isEmpty()) { if (player.getNearbyEntities(1, 1, 1).isEmpty()) {
boolean b; boolean b;
if (!Utilities.sprintFly(player)) { if (!Utilities.sprintFly(player)) {
@@ -73,50 +72,50 @@ public class WaterWalkCheck {
b = true; b = true;
} }
if (b) { if (b) {
if (waterSpeedViolation.containsKey(uuid)) { if (WATER_SPEED_VIOLATIONS.containsKey(uuid)) {
int v = waterSpeedViolation.get(uuid); int v = WATER_SPEED_VIOLATIONS.get(uuid);
if (v >= AntiCheatReloaded.getManager().getBackend().getMagic() if (v >= AntiCheatReloaded.getManager().getBackend().getMagic()
.WATER_SPEED_VIOLATION_MAX()) { .WATER_SPEED_VIOLATION_MAX()) {
waterSpeedViolation.put(uuid, 0); WATER_SPEED_VIOLATIONS.put(uuid, 0);
return new CheckResult(CheckResult.Result.FAILED, return new CheckResult(CheckResult.Result.FAILED,
player.getName() + " stood on water " + v + " times (can't stand on " player.getName() + " stood on water " + v + " times (can't stand on "
+ block.getType() + " or " + block.getType() + " or "
+ block.getRelative(BlockFace.DOWN).getType() + ")"); + block.getRelative(BlockFace.DOWN).getType() + ")");
} else { } else {
waterSpeedViolation.put(uuid, v + 1); WATER_SPEED_VIOLATIONS.put(uuid, v + 1);
} }
} else { } else {
waterSpeedViolation.put(uuid, 1); WATER_SPEED_VIOLATIONS.put(uuid, 1);
} }
} }
} }
} else { } else {
isInWaterCache.add(uuid); IS_IN_WATER_CACHE.add(uuid);
return PASS; return PASS;
} }
} else { } else {
isInWater.add(uuid); IS_IN_WATER.add(uuid);
return PASS; return PASS;
} }
} else if (block.getRelative(BlockFace.DOWN).isLiquid() } else if (block.getRelative(BlockFace.DOWN).isLiquid()
&& !AntiCheatReloaded.getManager().getBackend().isAscending(player) && Utilities.cantStandAt(block) && !AntiCheatReloaded.getManager().getBackend().isAscending(player) && Utilities.cantStandAt(block)
&& Utilities.cantStandAt(block.getRelative(BlockFace.DOWN))) { && Utilities.cantStandAt(block.getRelative(BlockFace.DOWN))) {
if (waterAscensionViolation.containsKey(uuid)) { if (WATER_ASCENSION_VIOLATIONS.containsKey(uuid)) {
int v = waterAscensionViolation.get(uuid); int v = WATER_ASCENSION_VIOLATIONS.get(uuid);
if (v >= AntiCheatReloaded.getManager().getBackend().getMagic().WATER_ASCENSION_VIOLATION_MAX()) { if (v >= AntiCheatReloaded.getManager().getBackend().getMagic().WATER_ASCENSION_VIOLATION_MAX()) {
waterAscensionViolation.put(uuid, 0); WATER_ASCENSION_VIOLATIONS.put(uuid, 0);
return new CheckResult(CheckResult.Result.FAILED, return new CheckResult(CheckResult.Result.FAILED,
player.getName() + " stood on water " + v + " times (can't stand on " + block.getType() player.getName() + " stood on water " + v + " times (can't stand on " + block.getType()
+ " or " + block.getRelative(BlockFace.DOWN).getType() + ")"); + " or " + block.getRelative(BlockFace.DOWN).getType() + ")");
} else { } else {
waterAscensionViolation.put(uuid, v + 1); WATER_ASCENSION_VIOLATIONS.put(uuid, v + 1);
} }
} else { } else {
waterAscensionViolation.put(uuid, 1); WATER_ASCENSION_VIOLATIONS.put(uuid, 1);
} }
} else { } else {
isInWater.remove(uuid); IS_IN_WATER.remove(uuid);
isInWaterCache.remove(uuid); IS_IN_WATER_CACHE.remove(uuid);
} }
} }
return PASS; return PASS;
@@ -37,13 +37,12 @@ import com.rammelkast.anticheatreloaded.util.VersionUtil;
public class YAxisCheck { public class YAxisCheck {
public static final Map<UUID, Double> LAST_Y_COORD_CACHE = new HashMap<UUID, Double>();
public static final Map<UUID, Long> LAST_Y_TIME = new HashMap<UUID, Long>();
public static final Map<UUID, Integer> Y_AXIS_VIOLATIONS = new HashMap<UUID, Integer>();
public static final Map<UUID, Long> LAST_Y_AXIS_VIOLATION = new HashMap<UUID, Long>();
private static final CheckResult PASS = new CheckResult(CheckResult.Result.PASSED); private static final CheckResult PASS = new CheckResult(CheckResult.Result.PASSED);
public static Map<UUID, Double> lastYcoord = new HashMap<UUID, Double>();
public static Map<UUID, Long> lastYtime = new HashMap<UUID, Long>();
public static Map<UUID, Integer> yAxisViolations = new HashMap<UUID, Integer>();
public static Map<UUID, Long> yAxisLastViolation = new HashMap<UUID, Long>();
private static boolean hasJumpPotion(Player player) { private static boolean hasJumpPotion(Player player) {
return player.hasPotionEffect(PotionEffectType.JUMP); return player.hasPotionEffect(PotionEffectType.JUMP);
} }
@@ -61,49 +60,49 @@ public class YAxisCheck {
double y1 = player.getLocation().getY(); double y1 = player.getLocation().getY();
UUID uuid = player.getUniqueId(); UUID uuid = player.getUniqueId();
// Fix Y axis spam. // Fix Y axis spam.
if (!lastYcoord.containsKey(uuid) || !lastYtime.containsKey(uuid) if (!LAST_Y_COORD_CACHE.containsKey(uuid) || !LAST_Y_TIME.containsKey(uuid)
|| !yAxisLastViolation.containsKey(uuid)) { || !LAST_Y_AXIS_VIOLATION.containsKey(uuid)) {
lastYcoord.put(uuid, y1); LAST_Y_COORD_CACHE.put(uuid, y1);
yAxisViolations.put(uuid, 0); Y_AXIS_VIOLATIONS.put(uuid, 0);
yAxisLastViolation.put(uuid, 0L); LAST_Y_AXIS_VIOLATION.put(uuid, 0L);
lastYtime.put(uuid, System.currentTimeMillis()); LAST_Y_TIME.put(uuid, System.currentTimeMillis());
} else { } else {
if (y1 > lastYcoord.get(uuid) if (y1 > LAST_Y_COORD_CACHE.get(uuid)
&& yAxisViolations.get(uuid) > AntiCheatReloaded.getManager().getBackend().getMagic() && Y_AXIS_VIOLATIONS.get(uuid) > AntiCheatReloaded.getManager().getBackend().getMagic()
.Y_MAXVIOLATIONS() .Y_MAXVIOLATIONS()
&& (System.currentTimeMillis() - yAxisLastViolation.get(uuid)) < AntiCheatReloaded.getManager() && (System.currentTimeMillis() - LAST_Y_AXIS_VIOLATION.get(uuid)) < AntiCheatReloaded.getManager()
.getBackend().getMagic().Y_MAXVIOTIME()) { .getBackend().getMagic().Y_MAXVIOTIME()) {
Location g = player.getLocation(); Location g = player.getLocation();
yAxisViolations.put(uuid, yAxisViolations.get(uuid) + 1); Y_AXIS_VIOLATIONS.put(uuid, Y_AXIS_VIOLATIONS.get(uuid) + 1);
yAxisLastViolation.put(uuid, System.currentTimeMillis()); LAST_Y_AXIS_VIOLATION.put(uuid, System.currentTimeMillis());
if (!AntiCheatReloaded.getManager().getBackend().silentMode()) { if (!AntiCheatReloaded.getManager().getBackend().silentMode()) {
g.setY(lastYcoord.get(uuid)); g.setY(LAST_Y_COORD_CACHE.get(uuid));
if (g.getBlock().getType() == Material.AIR) { if (g.getBlock().getType() == Material.AIR) {
player.teleport(g); player.teleport(g);
} }
} }
return new CheckResult(CheckResult.Result.FAILED, return new CheckResult(CheckResult.Result.FAILED,
player.getName() + " tried to fly on y-axis " + yAxisViolations.get(uuid) + " times (max =" player.getName() + " tried to fly on y-axis " + Y_AXIS_VIOLATIONS.get(uuid) + " times (max ="
+ AntiCheatReloaded.getManager().getBackend().getMagic().Y_MAXVIOLATIONS() + ")"); + AntiCheatReloaded.getManager().getBackend().getMagic().Y_MAXVIOLATIONS() + ")");
} else { } else {
if (yAxisViolations.get(uuid) > AntiCheatReloaded.getManager().getBackend().getMagic() if (Y_AXIS_VIOLATIONS.get(uuid) > AntiCheatReloaded.getManager().getBackend().getMagic()
.Y_MAXVIOLATIONS() .Y_MAXVIOLATIONS()
&& (System.currentTimeMillis() - yAxisLastViolation.get(uuid)) > AntiCheatReloaded && (System.currentTimeMillis() - LAST_Y_AXIS_VIOLATION.get(uuid)) > AntiCheatReloaded
.getManager().getBackend().getMagic().Y_MAXVIOTIME()) { .getManager().getBackend().getMagic().Y_MAXVIOTIME()) {
yAxisViolations.put(uuid, 0); Y_AXIS_VIOLATIONS.put(uuid, 0);
yAxisLastViolation.put(uuid, 0L); LAST_Y_AXIS_VIOLATION.put(uuid, 0L);
} }
} }
long i = System.currentTimeMillis() - lastYtime.get(uuid); long i = System.currentTimeMillis() - LAST_Y_TIME.get(uuid);
double diff = AntiCheatReloaded.getManager().getBackend().getMagic().Y_MAXDIFF() double diff = AntiCheatReloaded.getManager().getBackend().getMagic().Y_MAXDIFF()
+ (Utilities.isStair(player.getLocation().add(0, -1, 0).getBlock()) ? 0.5 : 0.0); + (Utilities.isStair(player.getLocation().add(0, -1, 0).getBlock()) ? 0.5 : 0.0);
if ((y1 - lastYcoord.get(uuid)) > diff if ((y1 - LAST_Y_COORD_CACHE.get(uuid)) > diff
&& i < AntiCheatReloaded.getManager().getBackend().getMagic().Y_TIME()) { && i < AntiCheatReloaded.getManager().getBackend().getMagic().Y_TIME()) {
Location g = player.getLocation(); Location g = player.getLocation();
yAxisViolations.put(uuid, yAxisViolations.get(uuid) + 1); Y_AXIS_VIOLATIONS.put(uuid, Y_AXIS_VIOLATIONS.get(uuid) + 1);
yAxisLastViolation.put(uuid, System.currentTimeMillis()); LAST_Y_AXIS_VIOLATION.put(uuid, System.currentTimeMillis());
if (!AntiCheatReloaded.getManager().getBackend().silentMode()) { if (!AntiCheatReloaded.getManager().getBackend().silentMode()) {
g.setY(lastYcoord.get(uuid)); g.setY(LAST_Y_COORD_CACHE.get(uuid));
if (g.getBlock().getType() == Material.AIR) { if (g.getBlock().getType() == Material.AIR) {
player.teleport(g); player.teleport(g);
} }
@@ -111,12 +110,12 @@ public class YAxisCheck {
return new CheckResult(CheckResult.Result.FAILED, player.getName() + " tried to fly on y-axis in " return new CheckResult(CheckResult.Result.FAILED, player.getName() + " tried to fly on y-axis in "
+ i + " ms (min =" + AntiCheatReloaded.getManager().getBackend().getMagic().Y_TIME() + ")"); + i + " ms (min =" + AntiCheatReloaded.getManager().getBackend().getMagic().Y_TIME() + ")");
} else { } else {
if ((y1 - lastYcoord.get(uuid)) > AntiCheatReloaded.getManager().getBackend().getMagic().Y_MAXDIFF() if ((y1 - LAST_Y_COORD_CACHE.get(uuid)) > AntiCheatReloaded.getManager().getBackend().getMagic().Y_MAXDIFF()
+ 1 + 1
|| (System.currentTimeMillis() - lastYtime.get(uuid)) > AntiCheatReloaded.getManager() || (System.currentTimeMillis() - LAST_Y_TIME.get(uuid)) > AntiCheatReloaded.getManager()
.getBackend().getMagic().Y_TIME()) { .getBackend().getMagic().Y_TIME()) {
lastYtime.put(uuid, System.currentTimeMillis()); LAST_Y_TIME.put(uuid, System.currentTimeMillis());
lastYcoord.put(uuid, y1); LAST_Y_COORD_CACHE.put(uuid, y1);
} }
} }
} }
@@ -29,18 +29,16 @@ import org.bukkit.event.entity.EntityDamageByEntityEvent;
import org.bukkit.event.entity.EntityDamageEvent; import org.bukkit.event.entity.EntityDamageEvent;
import org.bukkit.event.entity.EntityRegainHealthEvent; import org.bukkit.event.entity.EntityRegainHealthEvent;
import org.bukkit.event.entity.EntityRegainHealthEvent.RegainReason; import org.bukkit.event.entity.EntityRegainHealthEvent.RegainReason;
import org.bukkit.event.entity.EntityShootBowEvent;
import org.bukkit.event.entity.FoodLevelChangeEvent;
import com.rammelkast.anticheatreloaded.AntiCheatReloaded; import com.rammelkast.anticheatreloaded.AntiCheatReloaded;
import com.rammelkast.anticheatreloaded.check.CheckResult; import com.rammelkast.anticheatreloaded.check.CheckResult;
import com.rammelkast.anticheatreloaded.check.CheckType; import com.rammelkast.anticheatreloaded.check.CheckType;
import com.rammelkast.anticheatreloaded.check.combat.CriticalsCheck; import com.rammelkast.anticheatreloaded.check.combat.CriticalsCheck;
import com.rammelkast.anticheatreloaded.check.combat.KillAuraCheck;
import com.rammelkast.anticheatreloaded.check.combat.VelocityCheck; import com.rammelkast.anticheatreloaded.check.combat.VelocityCheck;
import com.rammelkast.anticheatreloaded.util.Distance; import com.rammelkast.anticheatreloaded.util.Distance;
import org.bukkit.event.entity.EntityShootBowEvent;
import org.bukkit.event.entity.FoodLevelChangeEvent;
public class EntityListener extends EventListener { public class EntityListener extends EventListener {
@EventHandler @EventHandler
@@ -105,9 +103,6 @@ public class EntityListener extends EventListener {
if (event instanceof EntityDamageByEntityEvent) { if (event instanceof EntityDamageByEntityEvent) {
EntityDamageByEntityEvent e = (EntityDamageByEntityEvent) event; EntityDamageByEntityEvent e = (EntityDamageByEntityEvent) event;
if (e.getDamager() instanceof Player) { if (e.getDamager() instanceof Player) {
if (getCheckManager().willCheck((Player)e.getDamager(), CheckType.KILLAURA)) {
KillAuraCheck.doDamageEvent(e, (Player)e.getDamager());
}
if (getCheckManager().willCheck((Player)e.getDamager(), CheckType.CRITICALS)) { if (getCheckManager().willCheck((Player)e.getDamager(), CheckType.CRITICALS)) {
CriticalsCheck.doDamageEvent(e, (Player)e.getDamager()); CriticalsCheck.doDamageEvent(e, (Player)e.getDamager());
} }
@@ -118,7 +113,7 @@ public class EntityListener extends EventListener {
if (e.getDamager() instanceof Player) { if (e.getDamager() instanceof Player) {
Player p = (Player) e.getDamager(); Player p = (Player) e.getDamager();
getBackend().logDamage(p, 1); getBackend().logDamage(p, 1);
int value = p.getInventory().getItemInHand().containsEnchantment(Enchantment.KNOCKBACK) ? 2 : 1; int value = p.getInventory().getItemInMainHand().containsEnchantment(Enchantment.KNOCKBACK) ? 2 : 1;
getBackend().logDamage(player, value); getBackend().logDamage(player, value);
if (getCheckManager().willCheck(p, CheckType.LONG_REACH)) { if (getCheckManager().willCheck(p, CheckType.LONG_REACH)) {
Distance distance = new Distance(player.getLocation(), p.getLocation()); Distance distance = new Distance(player.getLocation(), p.getLocation());
File diff suppressed because it is too large. Load diff
@@ -26,7 +26,7 @@ public enum Permission {
CHECK_ZOMBE_FLY, CHECK_ZOMBE_NOCLIP, CHECK_ZOMBE_CHEAT, CHECK_FLIGHT, CHECK_ELYTRA, CHECK_WATERWALK, CHECK_NOSWING, CHECK_FASTBREAK, CHECK_ZOMBE_FLY, CHECK_ZOMBE_NOCLIP, CHECK_ZOMBE_CHEAT, 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_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_SPIDER, CHECK_NOFALL, CHECK_FASTBOW, CHECK_FASTEAT, CHECK_FASTHEAL, CHECK_FORCEFIELD, CHECK_LONGREACH,
CHECK_FASTPROJECTILE, CHECK_ITEMSPAM, CHECK_VISUAL, CHECK_FASTINVENTORY, CHECK_AUTOTOOL, CHECK_KILLAURA, CHECK_BLINK, CHECK_VELOCITY, CHECK_CRITICALS, CHECK_UNICODE, CHECK_FASTPROJECTILE, CHECK_ITEMSPAM, CHECK_VISUAL, CHECK_FASTINVENTORY, CHECK_AUTOTOOL, CHECK_BLINK, CHECK_VELOCITY, CHECK_CRITICALS, CHECK_UNICODE,
/* System Nodes */ /* System Nodes */
SYSTEM_LOG, SYSTEM_RESET, SYSTEM_SPY, SYSTEM_HELP, SYSTEM_UPDATE, SYSTEM_REPORT, SYSTEM_ALERT, SYSTEM_NOTICE, SYSTEM_LOG, SYSTEM_RESET, SYSTEM_SPY, SYSTEM_HELP, SYSTEM_UPDATE, SYSTEM_REPORT, SYSTEM_ALERT, SYSTEM_NOTICE,
+4 -3
View File
@@ -130,9 +130,6 @@ permissions:
anticheat.check.autotool: anticheat.check.autotool:
description: Allow players to use autotool to switch tools quickly description: Allow players to use autotool to switch tools quickly
default: false default: false
anticheat.check.killaura:
description: Allow players to use killaura
default: false
anticheat.check.blink: anticheat.check.blink:
description: Allow players to send lots of movement packets description: Allow players to send lots of movement packets
default: false default: false
@@ -175,3 +172,7 @@ permissions:
anticheat.check.fastinventory: true anticheat.check.fastinventory: true
anticheat.check.autotool: true anticheat.check.autotool: true
anticheat.check.fastanimation: true anticheat.check.fastanimation: true
anticheat.check.blink: true
anticheat.check.velocity: true
anticheat.check.criticals: true
anticheat.check.unicode: true