From ce81d364797c90dcacf0726874fe053b1c0a7b2a Mon Sep 17 00:00:00 2001 From: Murat65536 Date: Thu, 28 Aug 2025 21:44:05 -0400 Subject: [PATCH] Convert to ternary operators. --- .../pathing/movement/MovementHelper.java | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/src/main/java/baritone/pathing/movement/MovementHelper.java b/src/main/java/baritone/pathing/movement/MovementHelper.java index 2d80d1d9b..ad4f29cbf 100644 --- a/src/main/java/baritone/pathing/movement/MovementHelper.java +++ b/src/main/java/baritone/pathing/movement/MovementHelper.java @@ -688,20 +688,9 @@ public interface MovementHelper extends ActionCosts, Helper { ).getYaw(); moveTowardsWithoutRotation(ctx, state, idealYaw); float distance = Rotation.yawDistanceFromOffset(ctx.playerRotations().getYaw(), idealYaw) % 45f; - float newYaw; - if (distance > 0) { - if (distance > 22.5f) { - newYaw = distance - 45f; - } else { - newYaw = distance; - } - } else { - if (distance < -22.5f) { - newYaw = distance + 45f; - } else { - newYaw = distance; - } - } + float newYaw = distance > 0f ? + distance > 22.5f ? distance - 45f : distance : + distance < -22.5f ? distance + 45f : distance; state.setTarget(new MovementTarget(new Rotation( ctx.playerRotations().getYaw() - newYaw, ctx.playerRotations().getPitch()