diff --git a/src/main/java/dev/tr7zw/notenoughanimations/util/AnimationUtil.java b/src/main/java/dev/tr7zw/notenoughanimations/util/AnimationUtil.java index 557b310..406c68c 100644 --- a/src/main/java/dev/tr7zw/notenoughanimations/util/AnimationUtil.java +++ b/src/main/java/dev/tr7zw/notenoughanimations/util/AnimationUtil.java @@ -159,14 +159,7 @@ public static float lerpAngle(float delta, float start, float end) { } public static float wrapDegrees(float angle) { - float wrappedAngle = angle % NMSHelper.TWO_PI; // 2 * π ≈ 6.28318531 - if (wrappedAngle >= NMSHelper.PI) { - wrappedAngle -= NMSHelper.TWO_PI; // 2 * π - } - if (wrappedAngle < -NMSHelper.PI) { - wrappedAngle += NMSHelper.TWO_PI; // 2 * π - } - return wrappedAngle; + return ((angle+NMSHelper.PI) % NMSHelper.TWO_PI) -NMSHelper.PI; } }