Fixed animation times not resetting, causing some animations to get stuck if still enabled when in the middle of a frame that lasts a very long time.

This commit is contained in:
luisc committed 2023-01-18 09:26:50 -06:00
1 parent 17c6fe9728
commit 46ea214b64
1 file changed
+2 -6
@@ -297,9 +297,7 @@ public class PacketHandlerClient extends PacketHandlerServer{
if (entity instanceof EntityNPCInterface) {
AnimationData data = ((EntityNPCInterface) entity).display.animationData;
data.readFromNBT(compound);
if (data.animation == null) {
data.animation = new Animation();
}
data.animation = new Animation();
data.animation.readFromNBT(compound.getCompoundTag("Animation"));
}
} else {
@@ -313,9 +311,7 @@ public class PacketHandlerClient extends PacketHandlerServer{
data = Client.playerAnimations.get(player.getUniqueID());
data.readFromNBT(compound);
}
if (data.animation == null) {
data.animation = new Animation();
}
data.animation = new Animation();
data.animation.readFromNBT(compound.getCompoundTag("Animation"));
Client.playerAnimations.put(player.getUniqueID(), data);
}