From 35fdd6f275ceaa2341e28eea74f942064818dc9d Mon Sep 17 00:00:00 2001 From: Louis_Quepierts Date: Fri, 23 Aug 2024 16:25:05 +0800 Subject: [PATCH] 1.2.4 fix --- .../api/animation/AnimationSection.java | 2 +- .../animation/keyframe/VariableHolder.java | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/common/src/main/java/net/quepierts/simpleanimator/api/animation/AnimationSection.java b/common/src/main/java/net/quepierts/simpleanimator/api/animation/AnimationSection.java index 77acab0..eb53fce 100644 --- a/common/src/main/java/net/quepierts/simpleanimator/api/animation/AnimationSection.java +++ b/common/src/main/java/net/quepierts/simpleanimator/api/animation/AnimationSection.java @@ -495,7 +495,7 @@ public void update(String variable, VariableHolder holder, ClientAnimator animat } else { final float time = Mth.clamp(animator.getTimer(), 0.0f, length); - holder.setValue(Interpolation.interpolation(frames, holder, time).get()); + holder.setValue(Interpolation.interpolation(frames, holder, time)); } } diff --git a/common/src/main/java/net/quepierts/simpleanimator/api/animation/keyframe/VariableHolder.java b/common/src/main/java/net/quepierts/simpleanimator/api/animation/keyframe/VariableHolder.java index 9710491..fd68276 100644 --- a/common/src/main/java/net/quepierts/simpleanimator/api/animation/keyframe/VariableHolder.java +++ b/common/src/main/java/net/quepierts/simpleanimator/api/animation/keyframe/VariableHolder.java @@ -55,6 +55,10 @@ public void setValue(float value) { this.value = value; } + public void setValue(VariableHolder holder) { + this.value = holder.value; + } + public int getAsInt() { return (int) this.value; } @@ -104,6 +108,13 @@ public Float2(Vector2f vector2f) { this.y = vector2f.y; } + @Override + public void setValue(VariableHolder holder) { + Vector2f vector2f = holder.getAsVector2f(); + this.setValue(vector2f.x); + this.y = vector2f.y; + } + @Override public Vector2f getAsVector2f() { return new Vector2f(get(), y); @@ -162,6 +173,14 @@ public Float3(Vector3f vector3f) { this.z = vector3f.z; } + @Override + public void setValue(VariableHolder holder) { + Vector3f vector3f = holder.getAsVector3f(); + this.setValue(vector3f.x); + this.y = vector3f.y; + this.z = vector3f.z; + } + @Override public Vector2f getAsVector2f() { return new Vector2f(get(), y);