mirror of
https://github.com/MCCTeam/Minecraft-Console-Client
synced 2025-10-14 21:22:49 +00:00
Fixed a crash on older versions
This commit is contained in:
parent
61a682a69b
commit
a5848f637b
1 changed files with 12 additions and 2 deletions
|
|
@ -833,7 +833,12 @@ namespace MinecraftClient.Protocol.Handlers
|
|||
if (handler.GetInventoryEnabled())
|
||||
{
|
||||
byte windowId = dataTypes.ReadNextByte(packetData);
|
||||
int stateId = dataTypes.ReadNextVarInt(packetData);
|
||||
|
||||
int stateId = -1;
|
||||
|
||||
if(protocolversion >= MC1181Version)
|
||||
stateId = dataTypes.ReadNextVarInt(packetData);
|
||||
|
||||
int elements = dataTypes.ReadNextVarInt(packetData);
|
||||
Dictionary<int, Item> inventorySlots = new Dictionary<int, Item>();
|
||||
for (short slotId = 0; slotId < elements; slotId++)
|
||||
|
|
@ -849,7 +854,12 @@ namespace MinecraftClient.Protocol.Handlers
|
|||
if (handler.GetInventoryEnabled())
|
||||
{
|
||||
byte windowID = dataTypes.ReadNextByte(packetData);
|
||||
int stateId = dataTypes.ReadNextVarInt(packetData);
|
||||
|
||||
int stateId = -1;
|
||||
|
||||
if(protocolversion >= MC1181Version)
|
||||
stateId = dataTypes.ReadNextVarInt(packetData);
|
||||
|
||||
short slotID = dataTypes.ReadNextShort(packetData);
|
||||
Item item = dataTypes.ReadNextItemSlot(packetData, itemPalette);
|
||||
handler.OnSetSlot(windowID, slotID, item);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue