Fix #167, vastly improved aimbot check (experimental)

This commit is contained in:
Rammelkast committed 2021-10-12 14:22:34 +02:00
1 parent e2d0fbda18
commit 78ae04a2a8
12 files changed
+110 -70

No files matched your search

@@ -59,6 +59,14 @@ public final class MovementManager {
public double lastDistanceX;
// Previous horizontal distance on z-axis of movement
public double lastDistanceZ;
// Delta pitch
public float deltaPitch;
// Delta yaw
public float deltaYaw;
// Previous delta pitch
public float lastDeltaPitch;
// Previous delta yaw
public float lastDeltaYaw;
// If the player touched the ground again this tick
public boolean touchedGroundThisTick = false;
// Last recorded distance
@@ -117,6 +125,11 @@ public final class MovementManager {
this.distanceXZ = Math.sqrt(x * x + z * z);
this.distanceX = x;
this.distanceZ = z;
this.lastDeltaPitch = this.deltaPitch;
this.lastDeltaYaw = this.deltaYaw;
this.deltaPitch = Math.abs(to.getPitch() - from.getPitch());
this.deltaYaw = Math.abs(Utilities.computeAngleDifference(to.getYaw(), from.getYaw()));
// Account for standing on boat
if (Utilities.couldBeOnBoat(player, 0.25, true) && !Utilities.isSubmersed(player)) {