Implemented Enchanting

Implemented Enchanting
This commit is contained in:
Anon 2022-10-14 16:02:34 +00:00 committed by GitHub
commit 12e2c6b4bb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
16 changed files with 776 additions and 65 deletions

View file

@ -770,6 +770,11 @@ namespace MinecraftClient.Protocol.Handlers
return false; //Currently not implemented
}
public bool ClickContainerButton(int windowId, int buttonId)
{
return false; //Currently not implemented
}
public bool SendCloseWindow(int windowId)
{
return false; //Currently not implemented

View file

@ -1382,6 +1382,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())
{
@ -2835,6 +2842,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