mirror of
https://github.com/darksaid98/AntiCheatReloaded.git
synced 2026-12-04 06:28:52 +00:00
Fixed false positives in glide check, removed broken figtspeed check.
This commit is contained in:
1 parent
9771387909
commit
da4a61e228
7 files changed
+41
-158
No files matched your search
@@ -143,6 +143,8 @@ public class Backend {
|
|||||||
YAxisCheck.LAST_Y_AXIS_VIOLATION.remove(pU);
|
YAxisCheck.LAST_Y_AXIS_VIOLATION.remove(pU);
|
||||||
YAxisCheck.LAST_Y_COORD_CACHE.remove(pU);
|
YAxisCheck.LAST_Y_COORD_CACHE.remove(pU);
|
||||||
YAxisCheck.LAST_Y_TIME.remove(pU);
|
YAxisCheck.LAST_Y_TIME.remove(pU);
|
||||||
|
WaterWalkCheck.WATER_ASCENSION_VIOLATIONS.remove(pU);
|
||||||
|
WaterWalkCheck.WATER_SPEED_VIOLATIONS.remove(pU);
|
||||||
fastBreaks.remove(pU);
|
fastBreaks.remove(pU);
|
||||||
blockBreakHolder.remove(pU);
|
blockBreakHolder.remove(pU);
|
||||||
lastBlockBroken.remove(pU);
|
lastBlockBroken.remove(pU);
|
||||||
@@ -150,8 +152,6 @@ public class Backend {
|
|||||||
lastBlockPlaced.remove(pU);
|
lastBlockPlaced.remove(pU);
|
||||||
lastBlockPlaceTime.remove(pU);
|
lastBlockPlaceTime.remove(pU);
|
||||||
blockPunches.remove(pU);
|
blockPunches.remove(pU);
|
||||||
WaterWalkCheck.WATER_ASCENSION_VIOLATIONS.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);
|
||||||
@@ -176,10 +176,9 @@ public class Backend {
|
|||||||
GlideCheck.VIOLATIONS.remove(pU);
|
GlideCheck.VIOLATIONS.remove(pU);
|
||||||
SpeedCheck.SPEED_VIOLATIONS.remove(player.getUniqueId());
|
SpeedCheck.SPEED_VIOLATIONS.remove(player.getUniqueId());
|
||||||
ElytraCheck.JUMP_Y_VALUE.remove(player.getUniqueId().toString());
|
ElytraCheck.JUMP_Y_VALUE.remove(player.getUniqueId().toString());
|
||||||
KillAuraCheck.ANGLE_FLAGS.remove(player.getUniqueId().toString());
|
KillAuraCheck.ANGLE_FLAGS.remove(pU);
|
||||||
KillAuraCheck.CLICKSPEED_MAP.remove(player.getUniqueId().toString());
|
KillAuraCheck.PITCH_MOVEMENTS_CACHE.remove(pU);
|
||||||
KillAuraCheck.DEVIATION_SCORES.remove(player.getUniqueId().toString());
|
KillAuraCheck.GCD_CACHE.remove(pU);
|
||||||
KillAuraCheck.DIFF_MAP.remove(player.getUniqueId().toString());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public CheckResult checkFastBow(Player player, float force) {
|
public CheckResult checkFastBow(Player player, float force) {
|
||||||
@@ -545,6 +544,10 @@ public class Backend {
|
|||||||
startEat.put(player.getUniqueId(), System.currentTimeMillis());
|
startEat.put(player.getUniqueId(), System.currentTimeMillis());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean isEating(Player player) {
|
||||||
|
return startEat.containsKey(player.getUniqueId()) && startEat.get(player.getUniqueId()) < magic.EAT_TIME_MIN();
|
||||||
|
}
|
||||||
|
|
||||||
public void logHeal(Player player) {
|
public void logHeal(Player player) {
|
||||||
lastHeal.put(player.getUniqueId(), System.currentTimeMillis());
|
lastHeal.put(player.getUniqueId(), System.currentTimeMillis());
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,6 +22,7 @@ import java.util.ArrayList;
|
|||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
import org.bukkit.entity.Entity;
|
import org.bukkit.entity.Entity;
|
||||||
@@ -29,36 +30,30 @@ import org.bukkit.entity.LivingEntity;
|
|||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.event.entity.EntityDamageEvent;
|
import org.bukkit.event.entity.EntityDamageEvent;
|
||||||
import org.bukkit.event.player.PlayerMoveEvent;
|
import org.bukkit.event.player.PlayerMoveEvent;
|
||||||
|
import org.bukkit.util.Vector;
|
||||||
|
|
||||||
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.config.providers.Magic;
|
|
||||||
import com.rammelkast.anticheatreloaded.util.Utilities;
|
import com.rammelkast.anticheatreloaded.util.Utilities;
|
||||||
import com.rammelkast.anticheatreloaded.util.checkassist.KillauraAssist;
|
|
||||||
|
|
||||||
public class KillAuraCheck {
|
public class KillAuraCheck {
|
||||||
|
|
||||||
// Angle check
|
// Angle check
|
||||||
public static final Map<String, Integer> ANGLE_FLAGS = new HashMap<String, Integer>();
|
public static final Map<UUID, Integer> ANGLE_FLAGS = new HashMap<UUID, Integer>();
|
||||||
// Heuristic fight speed check
|
// Aimbot check
|
||||||
public static final Map<String, Integer> DEVIATION_SCORES = new HashMap<String, Integer>();
|
public static final Map<UUID, List<Float>> PITCH_MOVEMENTS_CACHE = new HashMap<UUID, List<Float>>();
|
||||||
public static final Map<String, Integer> DIFF_MAP = new HashMap<String, Integer>();
|
public static final Map<UUID, Float> GCD_CACHE = new HashMap<UUID, Float>();
|
||||||
public static final Map<String, ClickSpeed> CLICKSPEED_MAP = new HashMap<String, ClickSpeed>();
|
|
||||||
// Heuristic aimbot check
|
|
||||||
public static final Map<String, List<Float>> PITCH_MOVEMENTS_CACHE = new HashMap<String, List<Float>>();
|
|
||||||
public static final Map<String, Float> GCD_CACHE = new HashMap<String, Float>();
|
|
||||||
// Not used as of now, code not committed yet
|
// Not used as of now, code not committed yet
|
||||||
private static final KillauraAssist KILLAURA_ASSIST;
|
|
||||||
private static final CheckResult PASS = new CheckResult(CheckResult.Result.PASSED);
|
private static final CheckResult PASS = new CheckResult(CheckResult.Result.PASSED);
|
||||||
|
|
||||||
public static CheckResult checkAngle(Player player, EntityDamageEvent event) {
|
public static CheckResult checkAngle(Player player, EntityDamageEvent event) {
|
||||||
String uuid = player.getUniqueId().toString();
|
UUID uuid = player.getUniqueId();
|
||||||
Entity entity = event.getEntity();
|
Entity entity = event.getEntity();
|
||||||
if (entity instanceof LivingEntity) {
|
if (entity instanceof LivingEntity) {
|
||||||
LivingEntity living = (LivingEntity) entity;
|
LivingEntity living = (LivingEntity) entity;
|
||||||
Location eyeLocation = player.getEyeLocation();
|
Location eyeLocation = player.getEyeLocation();
|
||||||
|
|
||||||
double yawDifference = KillauraAssist.calculateYawDifference(eyeLocation, living.getLocation());
|
double yawDifference = calculateYawDifference(eyeLocation, living.getLocation());
|
||||||
double playerYaw = player.getEyeLocation().getYaw();
|
double playerYaw = player.getEyeLocation().getYaw();
|
||||||
|
|
||||||
double angleDifference = Math.abs(180 - Math.abs(Math.abs(yawDifference - playerYaw) - 180));
|
double angleDifference = Math.abs(180 - Math.abs(Math.abs(yawDifference - playerYaw) - 180));
|
||||||
@@ -80,47 +75,11 @@ public class KillAuraCheck {
|
|||||||
return PASS;
|
return PASS;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static CheckResult checkFightSpeed(Player player, EntityDamageEvent event) {
|
|
||||||
String uuid = player.getUniqueId().toString();
|
|
||||||
if (!CLICKSPEED_MAP.containsKey(uuid)) {
|
|
||||||
CLICKSPEED_MAP.put(uuid, new ClickSpeed());
|
|
||||||
return PASS;
|
|
||||||
}
|
|
||||||
ClickSpeed clickSpeed = CLICKSPEED_MAP.get(uuid);
|
|
||||||
clickSpeed.registerClick();
|
|
||||||
int deviationScore = clickSpeed.getDeviationScore();
|
|
||||||
// Prevents false positives since scores under 2000 aren't reliable
|
|
||||||
if (deviationScore < 2000) {
|
|
||||||
return PASS;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!DEVIATION_SCORES.containsKey(uuid)) {
|
|
||||||
DEVIATION_SCORES.put(uuid, deviationScore);
|
|
||||||
return PASS;
|
|
||||||
}
|
|
||||||
|
|
||||||
Magic magic = AntiCheatReloaded.getManager().getConfiguration().getMagic();
|
|
||||||
int lastScore = DEVIATION_SCORES.get(uuid);
|
|
||||||
DEVIATION_SCORES.put(uuid, deviationScore);
|
|
||||||
int diff = Math.abs(deviationScore - lastScore);
|
|
||||||
if (!DIFF_MAP.containsKey(uuid)) {
|
|
||||||
DIFF_MAP.put(uuid, diff);
|
|
||||||
return PASS;
|
|
||||||
}
|
|
||||||
int lastDiff = DIFF_MAP.get(uuid);
|
|
||||||
DIFF_MAP.put(uuid, diff);
|
|
||||||
if (Math.abs(diff - lastDiff) < magic.KILLAURA_FIGHTSPEED_MINDIFF()) {
|
|
||||||
event.setCancelled(true);
|
|
||||||
return new CheckResult(CheckResult.Result.FAILED, "had a suspiciously consistant fighting speed (absdiff=" + Math.abs(diff - lastDiff) + ")");
|
|
||||||
}
|
|
||||||
return PASS;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Check idea by Hawk AntiCheat (https://github.com/HawkAnticheat/Hawk)
|
* Check idea by Hawk AntiCheat (https://github.com/HawkAnticheat/Hawk)
|
||||||
*/
|
*/
|
||||||
public static CheckResult checkAimbot(Player player, PlayerMoveEvent event) {
|
public static CheckResult checkAimbot(Player player, PlayerMoveEvent event) {
|
||||||
String uuid = player.getUniqueId().toString();
|
UUID uuid = player.getUniqueId();
|
||||||
float pitchMovement = event.getTo().getPitch() - event.getFrom().getPitch();
|
float pitchMovement = event.getTo().getPitch() - event.getFrom().getPitch();
|
||||||
if (!PITCH_MOVEMENTS_CACHE.containsKey(uuid)) {
|
if (!PITCH_MOVEMENTS_CACHE.containsKey(uuid)) {
|
||||||
PITCH_MOVEMENTS_CACHE.put(uuid, new ArrayList<Float>());
|
PITCH_MOVEMENTS_CACHE.put(uuid, new ArrayList<Float>());
|
||||||
@@ -152,49 +111,12 @@ public class KillAuraCheck {
|
|||||||
return PASS;
|
return PASS;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static class ClickSpeed {
|
|
||||||
private final List<Long> clicks;
|
|
||||||
private long lastClick;
|
|
||||||
|
|
||||||
public ClickSpeed() {
|
public static double calculateYawDifference(Location from, Location to) {
|
||||||
this.clicks = new ArrayList<Long>();
|
Location clonedFrom = from.clone();
|
||||||
this.lastClick = System.currentTimeMillis();
|
Vector startVector = clonedFrom.toVector();
|
||||||
|
Vector targetVector = to.toVector();
|
||||||
|
clonedFrom.setDirection(targetVector.subtract(startVector));
|
||||||
|
return clonedFrom.getYaw();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void registerClick() {
|
|
||||||
this.lastClick = System.currentTimeMillis();
|
|
||||||
this.clicks.add(this.lastClick);
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getDeviationScore() {
|
|
||||||
long last = 0;
|
|
||||||
List<Integer> deviation = new ArrayList<Integer>();
|
|
||||||
List<Long> toRemove = new ArrayList<Long>();
|
|
||||||
for (long clickTime : this.clicks) {
|
|
||||||
if (clickTime > (this.lastClick - 5000)) {
|
|
||||||
if (last == 0) {
|
|
||||||
last = clickTime;
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
deviation.add((int) (clickTime - last));
|
|
||||||
} else {
|
|
||||||
toRemove.add(clickTime);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
this.clicks.removeAll(toRemove);
|
|
||||||
if (deviation.isEmpty()) {
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
float averageDeviationScore = deviation.get(0);
|
|
||||||
for (int i = 1; i < deviation.size(); i++) {
|
|
||||||
averageDeviationScore += deviation.get(i);
|
|
||||||
}
|
|
||||||
return Math.round(averageDeviationScore / deviation.size());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static {
|
|
||||||
KILLAURA_ASSIST = new KillauraAssist();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -30,6 +30,7 @@ import org.bukkit.Material;
|
|||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
import com.rammelkast.anticheatreloaded.AntiCheatReloaded;
|
import com.rammelkast.anticheatreloaded.AntiCheatReloaded;
|
||||||
|
import com.rammelkast.anticheatreloaded.check.Backend;
|
||||||
import com.rammelkast.anticheatreloaded.check.CheckResult;
|
import com.rammelkast.anticheatreloaded.check.CheckResult;
|
||||||
import com.rammelkast.anticheatreloaded.util.Distance;
|
import com.rammelkast.anticheatreloaded.util.Distance;
|
||||||
import com.rammelkast.anticheatreloaded.util.Utilities;
|
import com.rammelkast.anticheatreloaded.util.Utilities;
|
||||||
@@ -81,8 +82,11 @@ public class GlideCheck {
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (fallDistance > LAST_FALL_DISTANCE.get(player.getUniqueId()) && !player.isOnGround()
|
if (fallDistance > LAST_FALL_DISTANCE.get(player.getUniqueId()) && !player.isOnGround()
|
||||||
&& Utilities.isNotNearSlime(distance.getTo().getBlock()) && fallDistance < 1.5) {
|
&& Utilities.isNotNearSlime(distance.getTo().getBlock()) && fallDistance < 1.5
|
||||||
// TODO that fallDistance check is a horrible way to prevent a certain false positive
|
&& !Utilities.isClimbableBlock(distance.getTo().getBlock()) && !player.isSneaking()
|
||||||
|
&& !AntiCheatReloaded.getManager().getBackend().isEating(player)) {
|
||||||
|
// TODO that fallDistance check is a horrible way to prevent a certain false
|
||||||
|
// positive
|
||||||
// Needs to be fixed since this only works for slight above ground movements
|
// Needs to be fixed since this only works for slight above ground movements
|
||||||
float predicted = calculateNextMotionY(LAST_MOTION_Y.get(player.getUniqueId()).floatValue());
|
float predicted = calculateNextMotionY(LAST_MOTION_Y.get(player.getUniqueId()).floatValue());
|
||||||
float actual = Double.valueOf(motionY).floatValue();
|
float actual = Double.valueOf(motionY).floatValue();
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ public class BadPacketsCheck {
|
|||||||
public static void runCheck(Player player, PacketEvent event) {
|
public static void runCheck(Player player, PacketEvent event) {
|
||||||
Backend backend = AntiCheatReloaded.getManager().getBackend();
|
Backend backend = AntiCheatReloaded.getManager().getBackend();
|
||||||
if (!AntiCheatReloaded.getManager().getCheckManager().willCheck(player, CheckType.BADPACKETS)
|
if (!AntiCheatReloaded.getManager().getCheckManager().willCheck(player, CheckType.BADPACKETS)
|
||||||
|| backend.isMovingExempt(player)) {
|
|| backend.isMovingExempt(player) || AntiCheatReloaded.getManager().getUserManager().getUser(player.getUniqueId()).isWaitingOnLevelSync()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -58,9 +58,13 @@ public class BadPacketsCheck {
|
|||||||
Location current = new Location(previous.getWorld(), x, y, z, yaw, pitch);
|
Location current = new Location(previous.getWorld(), x, y, z, yaw, pitch);
|
||||||
double distance = previous.distanceSquared(current);
|
double distance = previous.distanceSquared(current);
|
||||||
double maxDistance = backend.getMagic().BADPACKETS_MAX_DISTANCE();
|
double maxDistance = backend.getMagic().BADPACKETS_MAX_DISTANCE();
|
||||||
|
boolean hasNewLocation = packet.getBooleans().read(0);
|
||||||
if (distance > maxDistance) {
|
if (distance > maxDistance) {
|
||||||
flag(player, event, "moved too far between packets (distance=" + new BigDecimal(distance).setScale(1, RoundingMode.HALF_UP) + ", max=" + maxDistance + ")");
|
flag(player, event, "moved too far between packets (distance=" + new BigDecimal(distance).setScale(1, RoundingMode.HALF_UP) + ", max=" + maxDistance + ")");
|
||||||
return;
|
return;
|
||||||
|
} else if (distance < 1E-9 && !hasNewLocation) {
|
||||||
|
flag(player, event, "sent the same packet twice");
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -71,7 +75,7 @@ public class BadPacketsCheck {
|
|||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
EventListener.log(new CheckResult(CheckResult.Result.FAILED, message).getMessage(), player,
|
EventListener.log(new CheckResult(CheckResult.Result.FAILED, message).getMessage(), player,
|
||||||
CheckType.MOREPACKETS);
|
CheckType.BADPACKETS);
|
||||||
player.teleport(player.getLocation());
|
player.teleport(player.getLocation());
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -29,10 +29,10 @@ import org.bukkit.event.block.BlockPlaceEvent;
|
|||||||
|
|
||||||
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.combat.KillAuraCheck;
|
||||||
import com.rammelkast.anticheatreloaded.config.providers.Magic;
|
import com.rammelkast.anticheatreloaded.config.providers.Magic;
|
||||||
import com.rammelkast.anticheatreloaded.util.Utilities;
|
import com.rammelkast.anticheatreloaded.util.Utilities;
|
||||||
import com.rammelkast.anticheatreloaded.util.VersionUtil;
|
import com.rammelkast.anticheatreloaded.util.VersionUtil;
|
||||||
import com.rammelkast.anticheatreloaded.util.checkassist.KillauraAssist;
|
|
||||||
|
|
||||||
public class IllegalInteract {
|
public class IllegalInteract {
|
||||||
|
|
||||||
@@ -49,24 +49,21 @@ public class IllegalInteract {
|
|||||||
|
|
||||||
private static CheckResult checkBlockBreak(Player player, BlockBreakEvent event) {
|
private static CheckResult checkBlockBreak(Player player, BlockBreakEvent event) {
|
||||||
if (!isValidTarget(player, event.getBlock())) {
|
if (!isValidTarget(player, event.getBlock())) {
|
||||||
return new CheckResult(CheckResult.Result.FAILED,
|
return new CheckResult(CheckResult.Result.FAILED, "tried to break a block which was out of view");
|
||||||
"tried to break a block which was out of view");
|
|
||||||
}
|
}
|
||||||
return PASS;
|
return PASS;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static CheckResult checkBlockPlace(Player player, BlockPlaceEvent event) {
|
private static CheckResult checkBlockPlace(Player player, BlockPlaceEvent event) {
|
||||||
if (!isValidTarget(player, event.getBlock())) {
|
if (!isValidTarget(player, event.getBlock())) {
|
||||||
return new CheckResult(CheckResult.Result.FAILED,
|
return new CheckResult(CheckResult.Result.FAILED, "tried to place a block out of their view");
|
||||||
"tried to place a block out of their view");
|
|
||||||
}
|
}
|
||||||
return PASS;
|
return PASS;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static boolean isValidTarget(Player player, Block block) {
|
private static boolean isValidTarget(Player player, Block block) {
|
||||||
Magic magic = AntiCheatReloaded.getManager().getConfiguration().getMagic();
|
Magic magic = AntiCheatReloaded.getManager().getConfiguration().getMagic();
|
||||||
double distance =
|
double distance = player.getGameMode() == GameMode.CREATIVE ? magic.BLOCK_MAX_DISTANCE_CREATIVE()
|
||||||
player.getGameMode() == GameMode.CREATIVE ? magic.BLOCK_MAX_DISTANCE_CREATIVE()
|
|
||||||
: player.getLocation().getDirection().getY() > 0.9 ? magic.BLOCK_MAX_DISTANCE_CREATIVE()
|
: player.getLocation().getDirection().getY() > 0.9 ? magic.BLOCK_MAX_DISTANCE_CREATIVE()
|
||||||
: magic.BLOCK_MAX_DISTANCE();
|
: magic.BLOCK_MAX_DISTANCE();
|
||||||
Block targetBlock = VersionUtil.getTargetBlock(player, ((int) Math.ceil(distance)));
|
Block targetBlock = VersionUtil.getTargetBlock(player, ((int) Math.ceil(distance)));
|
||||||
@@ -86,7 +83,7 @@ public class IllegalInteract {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Location eyeLocation = player.getEyeLocation();
|
Location eyeLocation = player.getEyeLocation();
|
||||||
double yawDifference = KillauraAssist.calculateYawDifference(eyeLocation, block.getLocation());
|
double yawDifference = KillAuraCheck.calculateYawDifference(eyeLocation, block.getLocation());
|
||||||
double playerYaw = player.getEyeLocation().getYaw();
|
double playerYaw = player.getEyeLocation().getYaw();
|
||||||
double angleDifference = Math.abs(180 - Math.abs(Math.abs(yawDifference - playerYaw) - 180));
|
double angleDifference = Math.abs(180 - Math.abs(Math.abs(yawDifference - playerYaw) - 180));
|
||||||
if (Math.round(angleDifference) > magic.ILLEGALINTERACT_MAX_ANGLE_DIFFERENCE()) {
|
if (Math.round(angleDifference) > magic.ILLEGALINTERACT_MAX_ANGLE_DIFFERENCE()) {
|
||||||
|
|||||||
@@ -161,14 +161,6 @@ public class EntityListener extends EventListener {
|
|||||||
noHack = false;
|
noHack = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (getCheckManager().willCheck(player, CheckType.KILLAURA)) {
|
|
||||||
CheckResult result = KillAuraCheck.checkFightSpeed(player, event);
|
|
||||||
if (result.failed()) {
|
|
||||||
event.setCancelled(!silentMode());
|
|
||||||
log(result.getMessage(), player, CheckType.KILLAURA);
|
|
||||||
noHack = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (noHack) {
|
if (noHack) {
|
||||||
decrease(player);
|
decrease(player);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,39 +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.util.checkassist;
|
|
||||||
|
|
||||||
import org.bukkit.Location;
|
|
||||||
import org.bukkit.util.Vector;
|
|
||||||
|
|
||||||
public class KillauraAssist {
|
|
||||||
|
|
||||||
public KillauraAssist() {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public static double calculateYawDifference(Location from, Location to) {
|
|
||||||
Location clonedFrom = from.clone();
|
|
||||||
Vector startVector = clonedFrom.toVector();
|
|
||||||
Vector targetVector = to.toVector();
|
|
||||||
clonedFrom.setDirection(targetVector.subtract(startVector));
|
|
||||||
return clonedFrom.getYaw();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
Reference in new issue
Block a user