Fix #96, introduce Strafe check and fix flight, speed false positives

This commit is contained in:
Rammelkast committed 2020-08-01 22:35:51 +02:00
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))