mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-11 23:07:37 +00:00
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:
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) {
|
||||
|
||||
Reference in new issue
Block a user