From 661a36bc9b4dd02d02048dabc5c170e6d9cca249 Mon Sep 17 00:00:00 2001 From: tr7zw Date: Fri, 5 Jan 2024 00:24:45 +0100 Subject: [PATCH] Bump 1.7.0 --- gradle-compose.yml | 2 +- .../tr7zw/notenoughanimations/util/AnimationUtil.java | 10 +++++----- src/main/java/dev/tr7zw/util/NMSHelper.java | 6 +++--- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/gradle-compose.yml b/gradle-compose.yml index 1854cfa..a4ed24c 100644 --- a/gradle-compose.yml +++ b/gradle-compose.yml @@ -3,7 +3,7 @@ source: "https://github.com/tr7zw/ProcessedModTemplate/tree/master" replacements: name: "NotEnoughAnimations" id: "notenoughanimations" - version: "1.6.4" + version: "1.7.0" description: "Adding and improving animations in Third-Person." homepageUrl: "https://modrinth.com/mod/not-enough-animations" sourcesUrl: "https://github.com/tr7zw/NotEnoughAnimations" diff --git a/src/main/java/dev/tr7zw/notenoughanimations/util/AnimationUtil.java b/src/main/java/dev/tr7zw/notenoughanimations/util/AnimationUtil.java index 406c68c..a11c299 100644 --- a/src/main/java/dev/tr7zw/notenoughanimations/util/AnimationUtil.java +++ b/src/main/java/dev/tr7zw/notenoughanimations/util/AnimationUtil.java @@ -147,19 +147,19 @@ public static float interpolateRotation(float start, float end, float amount) { return wrapDegrees(wrappedStart + (wrappedEnd - wrappedStart) * amount); } - + public static float lerpAngle(float delta, float start, float end) { float wrappedStart = wrapDegrees(start); float wrappedEnd = wrapDegrees(end); - + float difference = wrappedEnd - wrappedStart; float shortestPath = ((difference + NMSHelper.PI) % NMSHelper.TWO_PI) - NMSHelper.PI; - + return wrapDegrees(wrappedStart + shortestPath * delta); } - + public static float wrapDegrees(float angle) { - return ((angle+NMSHelper.PI) % NMSHelper.TWO_PI) -NMSHelper.PI; + return ((angle + NMSHelper.PI) % NMSHelper.TWO_PI) - NMSHelper.PI; } } diff --git a/src/main/java/dev/tr7zw/util/NMSHelper.java b/src/main/java/dev/tr7zw/util/NMSHelper.java index 324a80d..4bb91c1 100644 --- a/src/main/java/dev/tr7zw/util/NMSHelper.java +++ b/src/main/java/dev/tr7zw/util/NMSHelper.java @@ -18,9 +18,9 @@ public class NMSHelper { - public static final float PI = (float) Math.PI; - public static final float HALF_PI = (float) (Math.PI / 2); - public static final float TWO_PI = (float) (Math.PI * 2); + public static final float PI = (float) Math.PI; + public static final float HALF_PI = (float) (Math.PI / 2); + public static final float TWO_PI = (float) (Math.PI * 2); // spotless:off //#if MC >= 11903