Added enchanting

This commit is contained in:
Milutinke 2022-10-12 19:51:01 +02:00
parent d222d5f683
commit 4dc1b420f5
12 changed files with 474 additions and 1 deletions

View file

@ -1364,6 +1364,13 @@ namespace MinecraftClient.Protocol.Handlers
handler.OnWindowItems(windowId, inventorySlots, stateId);
}
break;
case PacketTypesIn.WindowProperty:
byte containerId = dataTypes.ReadNextByte(packetData);
short propertyId = dataTypes.ReadNextShort(packetData);
short propertyValue = dataTypes.ReadNextShort(packetData);
handler.OnWindowProperties(containerId, propertyId, propertyValue);
break;
case PacketTypesIn.SetSlot:
if (handler.GetInventoryEnabled())
{
@ -2866,6 +2873,21 @@ namespace MinecraftClient.Protocol.Handlers
catch (ObjectDisposedException) { return false; }
}
public bool ClickContainerButton(int windowId, int buttonId)
{
try
{
List<byte> packet = new();
packet.Add((byte)windowId);
packet.Add((byte)buttonId);
SendPacket(PacketTypesOut.ClickWindowButton, packet);
return true;
}
catch (SocketException) { return false; }
catch (System.IO.IOException) { return false; }
catch (ObjectDisposedException) { return false; }
}
public bool SendAnimation(int animation, int playerid)
{
try