If the animation data is disabled for players, their last frame of animation will gradually interpolate back to the player's vanilla animations.

This commit is contained in:
Luis C.M committed 2023-12-22 17:25:40 -06:00
1 parent a67604e22d
commit bc089a4e14
4 files changed
+69 -17

No files matched your search

@@ -309,7 +309,9 @@ public class PacketHandlerClient extends PacketHandlerServer{
} else {
EntityPlayer sendingPlayer = Minecraft.getMinecraft().theWorld.getPlayerEntityByName(Server.readString(buffer));
if (sendingPlayer != null) {
ClientCacheHandler.playerAnimations.put(sendingPlayer.getUniqueID(), new AnimationData(sendingPlayer));
if (!ClientCacheHandler.playerAnimations.containsKey(sendingPlayer.getUniqueID())) {
ClientCacheHandler.playerAnimations.put(sendingPlayer.getUniqueID(), new AnimationData(sendingPlayer));
}
animationData = ClientCacheHandler.playerAnimations.get(sendingPlayer.getUniqueID());
}
}
@@ -326,10 +328,13 @@ public class PacketHandlerClient extends PacketHandlerServer{
animationId = animation.getID();
}
Animation animation = new Animation();
animation.readFromNBT(ClientCacheHandler.animationCache.get(animationId).writeToNBT());
animationData.animation = animation;
Client.sendData(EnumPacketServer.CacheAnimation, animationId);
if (animationData.allowAnimation) {
Animation animation = new Animation();
animation.readFromNBT(ClientCacheHandler.animationCache.get(animationId).writeToNBT());
animationData.animation = animation;
animation.parent = animationData;
Client.sendData(EnumPacketServer.CacheAnimation, animationId);
}
}
}
else if(type == EnumPacketClient.DISABLE_MOUSE_INPUT) {