From c2ef75df6d653587565517335193dfb6a5a44a00 Mon Sep 17 00:00:00 2001 From: Ghoulboy Date: Wed, 2 Nov 2022 20:02:56 +0100 Subject: [PATCH] Removed if clauses It was functionally equivalent to the solution proposed in #1072 --- .../java/carpet/helpers/EntityPlayerActionPack.java | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/src/main/java/carpet/helpers/EntityPlayerActionPack.java b/src/main/java/carpet/helpers/EntityPlayerActionPack.java index 4e71cf12..78c21906 100644 --- a/src/main/java/carpet/helpers/EntityPlayerActionPack.java +++ b/src/main/java/carpet/helpers/EntityPlayerActionPack.java @@ -237,14 +237,9 @@ public class EntityPlayerActionPack } } } - if (forward != 0.0F) - { - player.zza = forward*(sneaking?0.3F:1.0F); - } - if (strafing != 0.0F) - { - player.xxa = strafing*(sneaking?0.3F:1.0F); - } + float vel = sneaking?0.3F:1.0F; + player.zza = forward*vel; + player.xxa = strafing*vel; } static HitResult getTarget(ServerPlayer player)