diff --git a/MinecraftClient/Inventory/Item.cs b/MinecraftClient/Inventory/Item.cs index d2dc024b..643f4606 100644 --- a/MinecraftClient/Inventory/Item.cs +++ b/MinecraftClient/Inventory/Item.cs @@ -21,9 +21,10 @@ namespace MinecraftClient.Inventory public int Count; /// - /// Slot ID in the parent inventory (-1 means not specified) + /// Slot ID in the parent inventory /// - public int SlotID = -1; + /// -1 means currently being dragged by mouse + public int SlotID; /// /// Item Metadata @@ -37,12 +38,12 @@ namespace MinecraftClient.Inventory /// Item Count /// Item Slot ID in parent inventory /// Item Metadata - public Item(int ID,int Count,int SlotID, Dictionary NBT) + public Item(int id, int count, int slotID, Dictionary nbt) { - this.ID = ID; - this.Count = Count; - this.SlotID = SlotID; - this.NBT = NBT; + this.ID = id; + this.Count = count; + this.SlotID = slotID; + this.NBT = nbt; } /// @@ -51,22 +52,12 @@ namespace MinecraftClient.Inventory /// Item Type ID /// Item Count /// Item Slot ID in parent inventory - public Item(int ID, int Count, int SlotID) + public Item(int id, int count, int slotID) { - this.ID = ID; - this.Count = Count; - this.SlotID = SlotID; - } - - /// - /// Create an item with Type ID and Count - /// - /// Item Type ID - /// Item Count - public Item(int ID, int Count) - { - this.ID = ID; - this.Count = Count; + this.ID = id; + this.Count = count; + this.SlotID = slotID; + this.NBT = new Dictionary(); } } } diff --git a/MinecraftClient/Protocol/Handlers/Protocol18.cs b/MinecraftClient/Protocol/Handlers/Protocol18.cs index 0d1ae841..be0ce88a 100644 --- a/MinecraftClient/Protocol/Handlers/Protocol18.cs +++ b/MinecraftClient/Protocol/Handlers/Protocol18.cs @@ -566,7 +566,7 @@ namespace MinecraftClient.Protocol.Handlers byte itemCount = dataTypes.ReadNextByte(packetData); dataTypes.ReadNextNbt(packetData); - Item item = new Item(itemID, itemCount); + Item item = new Item(itemID, itemCount, i); itemsList.Add(i, item); } }