mirror of
https://github.com/MCCTeam/Minecraft-Console-Client
synced 2025-11-07 17:36:07 +00:00
Made Open Window to only parse packet before MC1.14
This commit is contained in:
parent
364afdfc72
commit
4b08912407
1 changed files with 10 additions and 7 deletions
|
|
@ -490,14 +490,17 @@ namespace MinecraftClient.Protocol.Handlers
|
|||
case PacketIncomingType.OpenWindow:
|
||||
if (handler.GetInventoryEnabled())
|
||||
{
|
||||
byte windowID = dataTypes.ReadNextByte(packetData);
|
||||
string type = dataTypes.ReadNextString(packetData).Replace("minecraft:", "").ToUpper();
|
||||
InventoryType inventoryType = (InventoryType)Enum.Parse(typeof(InventoryType), type);
|
||||
string title = dataTypes.ReadNextString(packetData);
|
||||
byte slots = dataTypes.ReadNextByte(packetData);
|
||||
Inventory inventory = new Inventory(windowID, inventoryType, title, slots);
|
||||
if (protocolversion < MC114Version) // packet changed at 1.14
|
||||
{
|
||||
byte windowID = dataTypes.ReadNextByte(packetData);
|
||||
string type = dataTypes.ReadNextString(packetData).Replace("minecraft:", "").ToUpper();
|
||||
InventoryType inventoryType = (InventoryType)Enum.Parse(typeof(InventoryType), type);
|
||||
string title = dataTypes.ReadNextString(packetData);
|
||||
byte slots = dataTypes.ReadNextByte(packetData);
|
||||
Inventory inventory = new Inventory(windowID, inventoryType, title, slots);
|
||||
|
||||
handler.OnInventoryOpen(inventory);
|
||||
handler.OnInventoryOpen(inventory);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case PacketIncomingType.CloseWindow:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue