Fix WaterWalk false positive

This commit is contained in:
Rammelkast committed 2020-08-04 16:27:31 +02:00
1 parent 97534e5df0
commit 16c778c17f
2 files changed
+8 -2

No files matched your search

@@ -44,12 +44,11 @@ public class WaterWalkCheck {
MovementManager movementManager = user.getMovementManager();
if (movementManager.distanceXZ <= 0 || player.getVehicle() != null || Utilities.isOnLilyPad(player)
|| VersionUtil.isRiptiding(player))
|| VersionUtil.isRiptiding(player) || VersionUtil.isSwimming(player))
return PASS;
Checks checksConfig = AntiCheatReloaded.getManager().getConfiguration().getChecks();
Block blockBeneath = player.getLocation().clone().subtract(0, 0.1, 0).getBlock();
if (checksConfig.isSubcheckEnabled(CheckType.WATER_WALK, "walk") && blockBeneath.isLiquid()
&& Utilities.isSurroundedByWater(player)
&& ((movementManager.motionY == 0 && movementManager.lastMotionY == 0)
@@ -147,4 +147,11 @@ public class VersionUtil {
return player.getPotionEffect(type).getAmplifier() + 1;
return 0;
}
public static boolean isSwimming(Player player) {
if (isBountifulUpdate()) {
return false;
}
return player.isSwimming();
}
}