diff --git a/changelog.md b/changelog.md index 147a401..239e15a 100644 --- a/changelog.md +++ b/changelog.md @@ -1,14 +1,8 @@ -Extra smoothness and extra compatibility change. - Changelog: -- **Fixed:** Delayed camera movement when train turns. -- **Added:** Debug option to display new value scales used to fix the aforementioned delayed camera movement. -- **Fixed:** Incompatibility with Figura combined with some mods. [#67](https://github.com/der-fruhling-entertainment/create-train-perspective/issues/67) - - (fixed via possibly temporary workaround. please report any other issues with this mod and mine! it likes to get breaky) -- **Technical:** Cleaned up the code a bit more. +- **Fixed:** Critical jittering bug introduced in v0.6.0 -[View full change log.](https://github.com/der-fruhling/create-train-perspective/compare/v0.5.0...v0.6.0) +[View full change log.](https://github.com/der-fruhling/create-train-perspective/compare/v0.6.0...v0.6.1) --- diff --git a/common/src/main/java/net/derfruhling/minecraft/create/trainperspective/Perspective.java b/common/src/main/java/net/derfruhling/minecraft/create/trainperspective/Perspective.java index 516c454..8cd8255 100644 --- a/common/src/main/java/net/derfruhling/minecraft/create/trainperspective/Perspective.java +++ b/common/src/main/java/net/derfruhling/minecraft/create/trainperspective/Perspective.java @@ -87,6 +87,15 @@ default float getYaw(float f) { var ref = getReference(); if (ref == null) return 0.0f; if (f == 1.0f) return ref.yaw * getValueScale(); + + while (ref.yaw - ref.prevYaw < -180.0f) { + ref.prevYaw -= 360.0f; + } + + while (ref.yaw - ref.prevYaw >= 180.0f) { + ref.prevYaw += 360.0f; + } + return Mth.lerp(f, ref.prevYaw * getPrevValueScale(), ref.yaw * getValueScale()); } diff --git a/gradle.properties b/gradle.properties index c451c7b..97c5dba 100644 --- a/gradle.properties +++ b/gradle.properties @@ -10,7 +10,7 @@ fabric_loader_version=0.15.7 fabric_api_version=0.77.0+1.19.2 # public info mod_id=create_train_perspective -mod_version=0.6.0 +mod_version=0.6.1 maven_group=net.derfruhling.minecraft archives_base_name=create-train-perspective # mod dependency versions