mirror of
https://github.com/darksaid98/AntiCheatReloaded.git
synced 2026-12-02 14:38:45 +00:00
Fix #96, introduce Strafe check and fix flight, speed false positives
This commit is contained in:
1 parent
3bc49141fc
commit
c74fc92da9
9 files changed
+100
-10
No files matched your search
@@ -45,8 +45,16 @@ public class MovementManager {
|
||||
public double lastMotionY;
|
||||
// Horizontal distance of movement
|
||||
public double distanceXZ;
|
||||
// Horizontal distance on x-axis of movement
|
||||
public double distanceX;
|
||||
// Horizontal distance on z-axis of movement
|
||||
public double distanceZ;
|
||||
// Previous horizontal distance of movement
|
||||
public double lastDistanceXZ;
|
||||
// Previous horizontal distance on x-axis of movement
|
||||
public double lastDistanceX;
|
||||
// Previous horizontal distance on z-axis of movement
|
||||
public double lastDistanceZ;
|
||||
// If the player touched the ground again this tick
|
||||
public boolean touchedGroundThisTick = false;
|
||||
// Last recorded distance
|
||||
@@ -84,7 +92,11 @@ public class MovementManager {
|
||||
double x = distance.getXDifference();
|
||||
double z = distance.getZDifference();
|
||||
this.lastDistanceXZ = this.distanceXZ;
|
||||
this.lastDistanceX = this.distanceX;
|
||||
this.lastDistanceZ = this.distanceZ;
|
||||
this.distanceXZ = Math.sqrt(x * x + z * z);
|
||||
this.distanceX = x;
|
||||
this.distanceZ = z;
|
||||
|
||||
// Account for standing on boat
|
||||
if (Utilities.couldBeOnBoat(player, 0.25, true) && !Utilities.isSubmersed(player))
|
||||
|
||||
@@ -27,7 +27,7 @@ public enum Permission {
|
||||
CHECK_SNEAK, CHECK_SPEED, CHECK_VCLIP, CHECK_SPIDER, CHECK_NOFALL, CHECK_FASTBOW, CHECK_FASTEAT, CHECK_FASTHEAL,
|
||||
CHECK_KILLAURA, CHECK_UNICODE, CHECK_FASTPROJECTILE, CHECK_ITEMSPAM, CHECK_FASTINVENTORY,
|
||||
CHECK_MOREPACKETS, CHECK_BADPACKETS, CHECK_VELOCITY, CHECK_CRITICALS, CHECK_ILLEGALINTERACT, CHECK_FASTLADDER,
|
||||
CHECK_AIMBOT,
|
||||
CHECK_AIMBOT, CHECK_STRAFE,
|
||||
|
||||
/* System Nodes */
|
||||
SYSTEM_LOG, SYSTEM_RESET, SYSTEM_HELP, SYSTEM_VERSION, SYSTEM_REPORT, SYSTEM_NOTICE, SYSTEM_CHECK, SYSTEM_RELOAD,
|
||||
|
||||
@@ -37,6 +37,7 @@ import org.bukkit.entity.Boat;
|
||||
import org.bukkit.entity.Entity;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.util.BoundingBox;
|
||||
import org.bukkit.util.NumberConversions;
|
||||
|
||||
public final class Utilities {
|
||||
@@ -226,6 +227,10 @@ public final class Utilities {
|
||||
}
|
||||
|
||||
public static boolean isHalfblock(Block block) {
|
||||
BoundingBox box = block.getBoundingBox();
|
||||
double height = box.getMaxY() - box.getMinY();
|
||||
if (height > 0.42 && height <= 0.6 && block.getType().isSolid())
|
||||
return true;
|
||||
return isSlab(block) || isStair(block) || isWall(block) || block.getType() == Material.SNOW;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user