mirror of
https://github.com/darksaid98/AntiCheatReloaded.git
synced 2026-12-03 14:38:46 +00:00
Fixed two WaterWalk falses
This commit is contained in:
1 parent
07f957cf35
commit
4deb8ae0fb
5 files changed
+18
-10
No files matched your search
@@ -3,7 +3,7 @@
|
|||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<groupId>com.rammelkast.anticheatreloaded</groupId>
|
<groupId>com.rammelkast.anticheatreloaded</groupId>
|
||||||
<artifactId>AntiCheatReloaded</artifactId>
|
<artifactId>AntiCheatReloaded</artifactId>
|
||||||
<version>1.9.0</version>
|
<version>1.9.1</version>
|
||||||
<name>AntiCheatReloaded</name>
|
<name>AntiCheatReloaded</name>
|
||||||
<url>https://www.spigotmc.org/resources/anticheatreloaded.23799/</url>
|
<url>https://www.spigotmc.org/resources/anticheatreloaded.23799/</url>
|
||||||
<properties>
|
<properties>
|
||||||
|
|||||||
@@ -100,7 +100,7 @@ public class SpeedCheck {
|
|||||||
if (Utilities.couldBeOnHalfblock(movingTowards) && movementManager.halfMovementHistoryCounter == 0)
|
if (Utilities.couldBeOnHalfblock(movingTowards) && movementManager.halfMovementHistoryCounter == 0)
|
||||||
predict *= 1.25D;
|
predict *= 1.25D;
|
||||||
// Boats sometimes give a false positive
|
// Boats sometimes give a false positive
|
||||||
if (Utilities.couldBeOnBoat(player, 0.5))
|
if (Utilities.couldBeOnBoat(player, 0.5, true))
|
||||||
predict *= 1.25D;
|
predict *= 1.25D;
|
||||||
// Strafing in air when nearing terminal velocity gives false positives
|
// Strafing in air when nearing terminal velocity gives false positives
|
||||||
// This fixes the issue but gives hackers some leniency which means we need another check for this
|
// This fixes the issue but gives hackers some leniency which means we need another check for this
|
||||||
|
|||||||
@@ -50,14 +50,17 @@ public class WaterWalkCheck {
|
|||||||
|
|
||||||
if (checksConfig.isSubcheckEnabled(CheckType.WATER_WALK, "walk") && blockBeneath.isLiquid()
|
if (checksConfig.isSubcheckEnabled(CheckType.WATER_WALK, "walk") && blockBeneath.isLiquid()
|
||||||
&& Utilities.isSurroundedByWater(player)
|
&& Utilities.isSurroundedByWater(player)
|
||||||
&& ((movementManager.motionY == 0 && movementManager.lastMotionY == 0) || movementManager.motionY == Utilities.JUMP_MOTION_Y)
|
&& ((movementManager.motionY == 0 && movementManager.lastMotionY == 0)
|
||||||
&& movementManager.distanceXZ > checksConfig.getDouble(CheckType.WATER_WALK, "walk", "minimumDistXZ"))
|
|| movementManager.motionY == Utilities.JUMP_MOTION_Y)
|
||||||
|
&& movementManager.distanceXZ > checksConfig.getDouble(CheckType.WATER_WALK, "walk", "minimumDistXZ")
|
||||||
|
&& !movementManager.topSolid && !Utilities.couldBeOnBoat(player, 3, false))
|
||||||
return new CheckResult(Result.FAILED,
|
return new CheckResult(Result.FAILED,
|
||||||
"tried to walk on water (xz=" + Utilities.roundDouble(movementManager.distanceXZ, 5) + ")");
|
"tried to walk on water (xz=" + Utilities.roundDouble(movementManager.distanceXZ, 5) + ")");
|
||||||
|
|
||||||
if (checksConfig.isSubcheckEnabled(CheckType.WATER_WALK, "hop") && blockBeneath.isLiquid()
|
if (checksConfig.isSubcheckEnabled(CheckType.WATER_WALK, "hop") && blockBeneath.isLiquid()
|
||||||
&& Utilities.isSurroundedByWater(player) && movementManager.onGround
|
&& Utilities.isSurroundedByWater(player) && movementManager.onGround
|
||||||
&& Math.abs(movementManager.motionY) < checksConfig.getDouble(CheckType.WATER_WALK, "hop", "maxMotionY"))
|
&& Math.abs(movementManager.motionY) < checksConfig.getDouble(CheckType.WATER_WALK, "hop", "maxMotionY")
|
||||||
|
&& !Utilities.couldBeOnBoat(player, 0.3, false))
|
||||||
return new CheckResult(Result.FAILED,
|
return new CheckResult(Result.FAILED,
|
||||||
"tried to hop on water (mY=" + Utilities.roundDouble(movementManager.motionY, 5) + ")");
|
"tried to hop on water (mY=" + Utilities.roundDouble(movementManager.motionY, 5) + ")");
|
||||||
|
|
||||||
|
|||||||
@@ -87,7 +87,7 @@ public class MovementManager {
|
|||||||
this.distanceXZ = Math.sqrt(x * x + z * z);
|
this.distanceXZ = Math.sqrt(x * x + z * z);
|
||||||
|
|
||||||
// Account for standing on boat
|
// Account for standing on boat
|
||||||
if (Utilities.couldBeOnBoat(player, 0.25))
|
if (Utilities.couldBeOnBoat(player, 0.25, true) && !Utilities.isSubmersed(player))
|
||||||
this.onGround = true;
|
this.onGround = true;
|
||||||
|
|
||||||
this.touchedGroundThisTick = false;
|
this.touchedGroundThisTick = false;
|
||||||
|
|||||||
@@ -124,13 +124,18 @@ public final class Utilities {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static boolean couldBeOnBoat(Player player) {
|
public static boolean couldBeOnBoat(Player player) {
|
||||||
return couldBeOnBoat(player, 0.35);
|
return couldBeOnBoat(player, 0.35, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean couldBeOnBoat(Player player, double range) {
|
public static boolean couldBeOnBoat(Player player, double range, boolean checkY) {
|
||||||
for (Entity entity : player.getNearbyEntities(range, range, range)) {
|
for (Entity entity : player.getNearbyEntities(range, range, range)) {
|
||||||
if (entity instanceof Boat)
|
if (entity instanceof Boat) {
|
||||||
return true;
|
if (((Boat) entity).getLocation().getY() < player.getLocation().getY() + 0.25) {
|
||||||
|
return true;
|
||||||
|
} else if (!checkY) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user