Skip to content

Commit

Permalink
Fixed flight, speed, strafe false positives near boats
Browse files Browse the repository at this point in the history
  • Loading branch information
marcomoesman committed Mar 2, 2021
1 parent 0d50bc3 commit 45712a8
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ public static CheckResult runCheck(Player player, Distance distance) {
|| Utilities.isNearBed(distance.getTo().clone().add(0, -0.51, 0)))
&& movementManager.motionY > 0.15))
&& movementManager.slimeInfluenceTicks == 0 && movementManager.elytraEffectTicks <= 25
&& !Utilities.couldBeOnBoat(player, 0.6d, false))
&& !Utilities.couldBeOnBoat(player, 0.8d, false))
return new CheckResult(CheckResult.Result.FAILED, "AirClimb",
"tried to climb air (mY=" + movementManager.motionY + ")");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ public static CheckResult checkXZSpeed(Player player, double x, double z, Locati
// Works against YPorts and mini jumps
if (checksConfig.isSubcheckEnabled(CheckType.SPEED, "jumpBehaviour") && movementManager.touchedGroundThisTick
&& !boxedIn && movementManager.slimeInfluenceTicks <= 10 && !Utilities.isNearHalfblock(movingTowards)
&& !Utilities.isNearHalfblock(movingTowards.clone().subtract(0, 0.51, 0))) {
&& !Utilities.isNearHalfblock(movingTowards.clone().subtract(0, 0.51, 0)) && !Utilities.couldBeOnBoat(player, 0.8d, false)) {
// This happens naturally
if (movementManager.airTicksBeforeGrounded == movementManager.groundTicks) {
double minimumDistXZ = checksConfig.getDouble(CheckType.SPEED, "jumpBehaviour", "minimumDistXZ"); // Default
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public static CheckResult runCheck(Player player, double x, double z, Location f

if (System.currentTimeMillis() - movementManager.lastTeleport <= checksConfig.getInteger(CheckType.STRAFE,
"accountForTeleports") || movementManager.elytraEffectTicks >= 20
|| movementManager.halfMovementHistoryCounter >= 20)
|| movementManager.halfMovementHistoryCounter >= 20 || Utilities.couldBeOnBoat(player, 0.5d, false))
return PASS;

Vector oldAcceleration = new Vector(movementManager.lastDistanceX, 0, movementManager.lastDistanceZ);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ public static boolean couldBeOnBoat(Player player) {
public static boolean couldBeOnBoat(Player player, double range, boolean checkY) {
for (Entity entity : player.getNearbyEntities(range, range, range)) {
if (entity instanceof Boat) {
if (((Boat) entity).getLocation().getY() < player.getLocation().getY() + 0.25) {
if (((Boat) entity).getLocation().getY() < player.getLocation().getY() + 0.35) {
return true;
} else if (!checkY) {
return true;
Expand Down

0 comments on commit 45712a8

Please sign in to comment.