public void HandleAnimation(MinecraftClient client, IPacket packet) { var Animation = (CBAnimation)packet; if (client.ThisPlayer != null && Animation.EntityID == client.ThisPlayer.Entity_ID) client.ThisPlayer.Animation = Animation.Animation; if (client.MinecraftWorld != null) { var index = client.MinecraftWorld.GetEntityById(Animation.EntityID); if (index != -1) client.MinecraftWorld.Entities[index].animation = (sbyte)Animation.Animation; } client.RaiseEntityAnimationChanged(this, Animation.EntityID, Animation.Animation); }
public void HandleAnimation(MinecraftClient client, IPacket packet) { var animation = (CbAnimation)packet; if (client.ThisPlayer != null && animation.EntityId == client.ThisPlayer.EntityId) client.ThisPlayer.Animation = animation.Animation; if (client.MinecraftWorld != null) { var index = client.MinecraftWorld.GetEntityById(animation.EntityId); if (index != -1) client.MinecraftWorld.Entities[index].Animation = (sbyte)animation.Animation; } client.RaiseEntityAnimationChanged(this, animation.EntityId, animation.Animation); }