From 7737337a86f60fe954cb7cafb05e506f505b67af Mon Sep 17 00:00:00 2001 From: SamB440 Date: Sun, 1 Dec 2024 18:34:52 +0000 Subject: [PATCH] Don't let setbacks bypass stuck speed --- .../java/ac/grim/grimac/manager/SetbackTeleportUtil.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/main/java/ac/grim/grimac/manager/SetbackTeleportUtil.java b/src/main/java/ac/grim/grimac/manager/SetbackTeleportUtil.java index 27413910c9..534a5ebcec 100644 --- a/src/main/java/ac/grim/grimac/manager/SetbackTeleportUtil.java +++ b/src/main/java/ac/grim/grimac/manager/SetbackTeleportUtil.java @@ -129,6 +129,7 @@ private void simulateFriction(Vector vector) { vector.setY(vector.getY() - 0.05); // Make the player fall a bit } else { // Gliding doesn't have friction, we handle it differently PredictionEngineNormal.staticVectorEndOfTick(player, vector); // Lava and normal movement + vector.multiply(player.stuckSpeedMultiplier); // Prevent abusing setbacks to move out of blocks like webs } // stop 1.8 players from stepping onto 1.25 high blocks, because why not? @@ -397,15 +398,15 @@ public void addSentTeleport(Location position, int transaction, RelativeFlag fla Vector3d safePosition = new Vector3d(position.getX(), position.getY(), position.getZ()); // We must convert relative teleports to avoid them becoming client controlled in the case of setback - if (flags.isSet(RelativeFlag.X.getMask())) { + if (flags.has(RelativeFlag.X)) { safePosition = safePosition.withX(safePosition.getX() + lastKnownGoodPosition.pos.getX()); } - if (flags.isSet(RelativeFlag.Y.getMask())) { + if (flags.has(RelativeFlag.Y)) { safePosition = safePosition.withY(safePosition.getY() + lastKnownGoodPosition.pos.getY()); } - if (flags.isSet(RelativeFlag.Z.getMask())) { + if (flags.has(RelativeFlag.Z)) { safePosition = safePosition.withZ(safePosition.getZ() + lastKnownGoodPosition.pos.getZ()); }