mirror of
https://github.com/MCCTeam/Minecraft-Console-Client
synced 2025-10-14 21:22:49 +00:00
Close Window & Toggle Setting
This commit is contained in:
parent
5895a4161f
commit
9c0e3f3bcb
6 changed files with 75 additions and 21 deletions
|
|
@ -465,7 +465,7 @@ namespace MinecraftClient.Protocol.Handlers
|
|||
compression_treshold = dataTypes.ReadNextVarInt(packetData);
|
||||
break;
|
||||
case PacketIncomingType.OpenWindow:
|
||||
if (protocolversion < MC1141Version)
|
||||
if (protocolversion < MC1141Version && handler.GetInventoryEnabled())
|
||||
{
|
||||
byte windowID = dataTypes.ReadNextByte(packetData);
|
||||
string type = dataTypes.ReadNextString(packetData).Replace("minecraft:", "").ToUpper();
|
||||
|
|
@ -474,12 +474,19 @@ namespace MinecraftClient.Protocol.Handlers
|
|||
byte slots = dataTypes.ReadNextByte(packetData);
|
||||
Inventory inventory = new Inventory(windowID, inventoryType, title, slots);
|
||||
|
||||
|
||||
handler.onInventoryOpen(inventory);
|
||||
}
|
||||
break;
|
||||
case PacketIncomingType.CloseWindow:
|
||||
if (protocolversion < MC1141Version && handler.GetInventoryEnabled())
|
||||
{
|
||||
byte windowID = dataTypes.ReadNextByte(packetData);
|
||||
|
||||
handler.onInventoryClose(windowID);
|
||||
}
|
||||
break;
|
||||
case PacketIncomingType.WindowItems:
|
||||
if (protocolversion < MC1141Version)
|
||||
if (protocolversion < MC1141Version && handler.GetInventoryEnabled())
|
||||
{
|
||||
byte id = dataTypes.ReadNextByte(packetData);
|
||||
short elements = dataTypes.ReadNextShort(packetData);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue