From e7cbe49a42b36cc929e9d6eadba54b5d6b58c976 Mon Sep 17 00:00:00 2001 From: TheMode Date: Sat, 14 Aug 2021 20:33:58 +0200 Subject: [PATCH] Fix middle click --- src/main/java/net/minestom/server/listener/WindowListener.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/net/minestom/server/listener/WindowListener.java b/src/main/java/net/minestom/server/listener/WindowListener.java index e4b4e5bef..b84420504 100644 --- a/src/main/java/net/minestom/server/listener/WindowListener.java +++ b/src/main/java/net/minestom/server/listener/WindowListener.java @@ -119,7 +119,8 @@ public class WindowListener { ((PlayerInventory) inventory).setCursorItem(itemStack); } else if (inventory instanceof Inventory) { ((Inventory) inventory).setCursorItem(player, itemStack); + } else { + throw new RuntimeException("Invalid inventory: " + inventory.getClass()); } - throw new RuntimeException("Invalid inventory: " + inventory.getClass()); } }