Fixed animations not transitioning correctly when updating from a looping animation.

This commit is contained in:
Luis C.M. committed 2024-04-04 22:36:11 -05:00
1 parent 963393b7fe
commit a07a33c068
2 files changed
+6 -3

No files matched your search

@@ -264,10 +264,13 @@ public class AnimationData implements IAnimationData {
CommonProxy.clientPlayingAnimations.add(newAnim);
}
}
Animation prevAnim = this.animation;
this.animation = newAnim;
if (this.isActive() && newAnim != null && !newAnim.frames.isEmpty()) {
Frame frame = (Frame) this.animation.currentFrame();
if (this.getMCEntity() != null && this.getMCEntity().worldObj.isRemote &&
this.isActive() && prevAnim != null && newAnim != null && !newAnim.frames.isEmpty()) {
Frame frame = (Frame) prevAnim.currentFrame();
if (frame != null) {
Frame firstFrame = newAnim.frames.get(0);
for (Map.Entry<EnumAnimationPart, FramePart> entry : frame.frameParts.entrySet()) {