new command /animation (#1026)

This commit is contained in:
Рома Данилов 2020-05-26 14:02:09 +05:00 committed by GitHub
parent 23870711a0
commit 87b2d3bf4a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 409 additions and 311 deletions

View file

@ -1391,6 +1391,28 @@ namespace MinecraftClient.Protocol.Handlers
catch (ObjectDisposedException) { return false; }
}
public bool SendAnimation(int animation)
{
try
{
if (animation == 0 || animation == 1)
{
List<byte> packet = new List<byte>();
packet.AddRange(dataTypes.GetVarInt(animation));
SendPacket(PacketOutgoingType.Animation, packet);
return true;
}
else;
{
return false;
}
}
catch (SocketException) { return false; }
catch (System.IO.IOException) { return false; }
catch (ObjectDisposedException) { return false; }
}
public bool SendCloseWindow(int windowId)
{
try