Fixed 3 false positives in water, one with beds and returned to old "getGoodLocation"

This commit is contained in:
Rammelkast committed 2020-07-21 13:19:35 +02:00
1 parent 168c25e5d2
commit 6966582e4c
8 files changed
+42 -14

No files matched your search

@@ -60,7 +60,7 @@ public class FlightCheck {
Backend backend = AntiCheatReloaded.getManager().getBackend();
Checks checksConfig = AntiCheatReloaded.getManager().getConfiguration().getChecks();
if (Utilities.isNearWater(player) || movementManager.halfMovement
if (movementManager.nearLiquidTicks > 0 || movementManager.halfMovement
|| Utilities.isClimbableBlock(distance.getFrom().getBlock())
|| Utilities.isClimbableBlock(distance.getFrom().getBlock().getRelative(BlockFace.DOWN))
|| Utilities.isClimbableBlock(distance.getFrom().getBlock().getRelative(BlockFace.UP)))
@@ -115,7 +115,9 @@ public class FlightCheck {
&& !AntiCheatReloaded.getManager().getBackend().justVelocity(player)
&& !player.hasPotionEffect(PotionEffectType.JUMP)
&& (System.currentTimeMillis() - movementManager.lastTeleport >= checksConfig
.getInteger(CheckType.FLIGHT, "airClimb", "accountForTeleports")))
.getInteger(CheckType.FLIGHT, "airClimb", "accountForTeleports"))
&& (!Utilities.isNearBed(distance.getTo())
|| (Utilities.isNearBed(distance.getTo()) && movementManager.motionY > 0.12675)))
return new CheckResult(CheckResult.Result.FAILED,
"tried to climb air (mY=" + movementManager.motionY + ")");