Fix flight false positive when building upwards

This commit is contained in:
Rammelkast committed 2021-02-17 16:47:55 +01:00
1 parent caffebe09d
commit 0d50bc3b52
1 file changed
+3 -1
@@ -152,12 +152,14 @@ public class FlightCheck {
"tried to climb air (mY=" + movementManager.motionY + ", at=" + movementManager.airTicks + ")");
}
// TODO hardcoded value against false
if (checksConfig.isSubcheckEnabled(CheckType.FLIGHT, "airClimb") && movementManager.airTicks >= minAirTicks
&& movementManager.lastMotionY < 0 && movementManager.motionY > 0
&& !AntiCheatReloaded.getManager().getBackend().justVelocity(player)
&& movementManager.elytraEffectTicks <= 25
&& (System.currentTimeMillis() - movementManager.lastTeleport >= checksConfig
.getInteger(CheckType.FLIGHT, "airClimb", "accountForTeleports"))) {
.getInteger(CheckType.FLIGHT, "airClimb", "accountForTeleports"))
&& !(Math.round(movementManager.motionY * 1000) == 396) && movementManager.airTicks == 15) {
return new CheckResult(CheckResult.Result.FAILED, "AirClimb",
"tried to climb air (mY=" + movementManager.motionY + ", at=" + movementManager.airTicks + ")");
}