diff --git a/src/main/java/net/knarcraft/knargui/GUIListener.java b/src/main/java/net/knarcraft/knargui/GUIListener.java index 8e60a16..1856f65 100644 --- a/src/main/java/net/knarcraft/knargui/GUIListener.java +++ b/src/main/java/net/knarcraft/knargui/GUIListener.java @@ -6,6 +6,7 @@ import org.bukkit.event.EventHandler; import org.bukkit.event.Listener; import org.bukkit.event.inventory.InventoryClickEvent; import org.bukkit.event.inventory.InventoryCloseEvent; +import org.bukkit.event.inventory.InventoryType; import org.bukkit.event.player.PlayerQuitEvent; /** @@ -36,7 +37,8 @@ public class GUIListener implements Listener { AbstractGUI gui = GUIRegistry.getOpenGUI(player); //Not our GUI - if (gui == null) { + if (gui == null || event.getClickedInventory() == null || + event.getClickedInventory().getType() == InventoryType.PLAYER) { return; }