From d1ca49fc3b17523726f7d3a6f0330fed1246bbcc Mon Sep 17 00:00:00 2001 From: "Luis C.M" <42545778+c0508383@users.noreply.github.com> Date: Sun, 24 Mar 2024 03:51:36 -0500 Subject: [PATCH] Made tick duration return the correct value for animating. --- src/main/java/noppes/npcs/CommonProxy.java | 3 ++- src/main/java/noppes/npcs/controllers/data/Frame.java | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/java/noppes/npcs/CommonProxy.java b/src/main/java/noppes/npcs/CommonProxy.java index bc49db973..68c9db672 100644 --- a/src/main/java/noppes/npcs/CommonProxy.java +++ b/src/main/java/noppes/npcs/CommonProxy.java @@ -49,7 +49,8 @@ public class CommonProxy implements IGuiHandler { HashSet playingAnimations = CustomNpcs.proxy.hasClient() ? clientPlayingAnimations : serverPlayingAnimations; for (int i = 0; i < animationTimer.elapsedTicks; ++i) { for (Animation animation : playingAnimations) { - if (animation.parent.isActive() && totalTicks % animation.currentFrame().tickDuration() == 0) { + int tickDuration = animation.currentFrame().tickDuration(); + if (animation.parent.isActive() && totalTicks % tickDuration == 0) { animation.increaseTime(); } } diff --git a/src/main/java/noppes/npcs/controllers/data/Frame.java b/src/main/java/noppes/npcs/controllers/data/Frame.java index 22077bf1a..df810234b 100644 --- a/src/main/java/noppes/npcs/controllers/data/Frame.java +++ b/src/main/java/noppes/npcs/controllers/data/Frame.java @@ -77,7 +77,7 @@ public class Frame implements IFrame { } public int tickDuration() { - return this.tickDuration; + return !this.customized && this.parent != null ? this.parent.tickDuration : this.tickDuration; } public IFrame setTickDuration(int tickDuration) {