From 6c51631a29dfcd299f916dc1b275aec0573dfafb Mon Sep 17 00:00:00 2001 From: TheMode Date: Sun, 6 Jun 2021 03:30:33 +0200 Subject: [PATCH] Fix inventory drop --- .../net/minestom/server/listener/WindowListener.java | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/main/java/net/minestom/server/listener/WindowListener.java b/src/main/java/net/minestom/server/listener/WindowListener.java index c8fefa3cb..08bc7998c 100644 --- a/src/main/java/net/minestom/server/listener/WindowListener.java +++ b/src/main/java/net/minestom/server/listener/WindowListener.java @@ -39,9 +39,17 @@ public class WindowListener { if (clickType == ClientClickWindowPacket.ClickType.PICKUP) { if (button == 0) { - successful = inventory.leftClick(player, slot); + if (slot != -999) { + successful = inventory.leftClick(player, slot); + } else { + successful = inventory.drop(player, true, slot, button); + } } else if (button == 1) { - successful = inventory.rightClick(player, slot); + if (slot != -999) { + successful = inventory.rightClick(player, slot); + } else { + successful = inventory.drop(player, false, slot, button); + } } } else if (clickType == ClientClickWindowPacket.ClickType.QUICK_MOVE) { successful = inventory.shiftClick(player, slot);