Complete inventory clicking mechanism

Update player inventory and opened container after clicking on slots
This commit is contained in:
ReinforceZwei 2020-07-05 15:48:19 +08:00 committed by ORelio
parent 855bdade0b
commit 93b72eb83e
2 changed files with 145 additions and 13 deletions

View file

@ -1577,18 +1577,11 @@ namespace MinecraftClient.Protocol.Handlers
button = 0;
mode = 4;
item = new Item(-1, 0, null);
Container inventory = handler.GetInventory(windowId);
if (inventory.Items.ContainsKey(slotId))
inventory.Items[slotId].Count--; // server won't update us after dropped
if (inventory.Items[slotId].Count == 0)
inventory.Items.Remove(slotId);
break;
case WindowActionType.DropItemStack:
button = 1;
mode = 4;
item = new Item(-1, 0, null);
inventory = handler.GetInventory(windowId);
inventory.Items.Remove(slotId); // server won't update us after dropped
break;
}