mirror of
https://github.com/MCCTeam/Minecraft-Console-Client
synced 2025-11-07 17:36:07 +00:00
new command /animation (#1026)
This commit is contained in:
parent
23870711a0
commit
87b2d3bf4a
9 changed files with 409 additions and 311 deletions
|
|
@ -27,6 +27,7 @@ namespace MinecraftClient.Protocol.Handlers
|
|||
ClickWindow,
|
||||
CloseWindow,
|
||||
PlayerBlockPlacement,
|
||||
CreativeInventoryAction
|
||||
CreativeInventoryAction,
|
||||
Animation
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -692,7 +692,10 @@ namespace MinecraftClient.Protocol.Handlers
|
|||
{
|
||||
return false; //Currently not implemented
|
||||
}
|
||||
|
||||
public bool SendAnimation(int animation)
|
||||
{
|
||||
return false; //Currently not implemented
|
||||
}
|
||||
public bool SendCreativeInventoryAction(int slot, ItemType item, int count)
|
||||
{
|
||||
return false; //Currently not implemented
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -417,7 +417,8 @@ namespace MinecraftClient.Protocol.Handlers
|
|||
case PacketOutgoingType.PlayerBlockPlacement: return 0x2C;
|
||||
case PacketOutgoingType.ClickWindow: return 0x09;
|
||||
case PacketOutgoingType.CloseWindow: return 0x0A;
|
||||
case PacketOutgoingType.EntityAction: return 0x1B;
|
||||
case PacketOutgoingType.EntityAction: return 0x1B;
|
||||
case PacketOutgoingType.Animation: return 0x2A;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue