diff --git a/pom.xml b/pom.xml
index d71c3b9..6ab43c9 100644
--- a/pom.xml
+++ b/pom.xml
@@ -3,7 +3,7 @@
4.0.0
com.rammelkast.anticheatreloaded
AntiCheatReloaded
- 1.9.0
+ 1.9.1
AntiCheatReloaded
https://www.spigotmc.org/resources/anticheatreloaded.23799/
diff --git a/src/main/java/com/rammelkast/anticheatreloaded/check/movement/SpeedCheck.java b/src/main/java/com/rammelkast/anticheatreloaded/check/movement/SpeedCheck.java
index 935c17b..7d0ed76 100644
--- a/src/main/java/com/rammelkast/anticheatreloaded/check/movement/SpeedCheck.java
+++ b/src/main/java/com/rammelkast/anticheatreloaded/check/movement/SpeedCheck.java
@@ -100,7 +100,7 @@ public class SpeedCheck {
if (Utilities.couldBeOnHalfblock(movingTowards) && movementManager.halfMovementHistoryCounter == 0)
predict *= 1.25D;
// Boats sometimes give a false positive
- if (Utilities.couldBeOnBoat(player, 0.5))
+ if (Utilities.couldBeOnBoat(player, 0.5, true))
predict *= 1.25D;
// 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
diff --git a/src/main/java/com/rammelkast/anticheatreloaded/check/movement/WaterWalkCheck.java b/src/main/java/com/rammelkast/anticheatreloaded/check/movement/WaterWalkCheck.java
index 42cba77..798e675 100644
--- a/src/main/java/com/rammelkast/anticheatreloaded/check/movement/WaterWalkCheck.java
+++ b/src/main/java/com/rammelkast/anticheatreloaded/check/movement/WaterWalkCheck.java
@@ -50,14 +50,17 @@ public class WaterWalkCheck {
if (checksConfig.isSubcheckEnabled(CheckType.WATER_WALK, "walk") && blockBeneath.isLiquid()
&& Utilities.isSurroundedByWater(player)
- && ((movementManager.motionY == 0 && movementManager.lastMotionY == 0) || movementManager.motionY == Utilities.JUMP_MOTION_Y)
- && movementManager.distanceXZ > checksConfig.getDouble(CheckType.WATER_WALK, "walk", "minimumDistXZ"))
+ && ((movementManager.motionY == 0 && movementManager.lastMotionY == 0)
+ || 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,
"tried to walk on water (xz=" + Utilities.roundDouble(movementManager.distanceXZ, 5) + ")");
if (checksConfig.isSubcheckEnabled(CheckType.WATER_WALK, "hop") && blockBeneath.isLiquid()
&& 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,
"tried to hop on water (mY=" + Utilities.roundDouble(movementManager.motionY, 5) + ")");
diff --git a/src/main/java/com/rammelkast/anticheatreloaded/util/MovementManager.java b/src/main/java/com/rammelkast/anticheatreloaded/util/MovementManager.java
index 505f5c9..042620a 100644
--- a/src/main/java/com/rammelkast/anticheatreloaded/util/MovementManager.java
+++ b/src/main/java/com/rammelkast/anticheatreloaded/util/MovementManager.java
@@ -87,7 +87,7 @@ public class MovementManager {
this.distanceXZ = Math.sqrt(x * x + z * z);
// 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.touchedGroundThisTick = false;
diff --git a/src/main/java/com/rammelkast/anticheatreloaded/util/Utilities.java b/src/main/java/com/rammelkast/anticheatreloaded/util/Utilities.java
index 692ee16..797b8c6 100644
--- a/src/main/java/com/rammelkast/anticheatreloaded/util/Utilities.java
+++ b/src/main/java/com/rammelkast/anticheatreloaded/util/Utilities.java
@@ -124,17 +124,22 @@ public final class Utilities {
}
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)) {
- if (entity instanceof Boat)
- return true;
+ if (entity instanceof Boat) {
+ if (((Boat) entity).getLocation().getY() < player.getLocation().getY() + 0.25) {
+ return true;
+ } else if (!checkY) {
+ return true;
+ }
+ }
}
return false;
}
-
+
/**
* Determine whether a player could be standing on ice
*