Fixed animations being stuck. Animations should now properly continue where they left off when a player rejoins a server/ singleplayer world.

This commit is contained in:
Luis C.M committed 2024-03-29 16:37:31 -05:00
1 parent fd4a6d0a2c
commit 266a6515e5
7 files changed
+171 -65

No files matched your search

@@ -375,8 +375,14 @@ public class PacketHandlerClient extends PacketHandlerServer{
}
animationData.setAnimation(ClientCacheHandler.animationCache.get(animationId));
animationData.readFromNBT(compound);
Client.sendData(EnumPacketServer.CacheAnimation, animationId);
animationData.viewReadFromNBT(compound);
if (compound.hasKey("Frame")) {
animationData.animation.readFromNBT(compound.getCompoundTag("Animation"));
animationData.animation.jumpToFrameAtTime(compound.getInteger("Frame"), compound.getInteger("Time"));
} else if (compound.hasKey("Animation")) {
Client.sendData(EnumPacketServer.CacheAnimation, animationId);
}
}
}
else if(type == EnumPacketClient.DISABLE_MOUSE_INPUT) {