From 045fc42649bc3177bce4b5a07d87a6b4a489302e Mon Sep 17 00:00:00 2001 From: Bukkit/Spigot Date: Sun, 16 Aug 2020 11:21:05 +1000 Subject: [PATCH] #540: Add Inventory#isEmpty() By: Parker Hawke --- .../src/main/java/org/bukkit/inventory/Inventory.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/paper-api/src/main/java/org/bukkit/inventory/Inventory.java b/paper-api/src/main/java/org/bukkit/inventory/Inventory.java index 5a38d8f13b..5576a6a8df 100644 --- a/paper-api/src/main/java/org/bukkit/inventory/Inventory.java +++ b/paper-api/src/main/java/org/bukkit/inventory/Inventory.java @@ -288,6 +288,14 @@ public interface Inventory extends Iterable { */ public int firstEmpty(); + /** + * Check whether or not this inventory is empty. An inventory is considered + * to be empty if there are no ItemStacks in any slot of this inventory. + * + * @return true if empty, false otherwise + */ + public boolean isEmpty(); + /** * Removes all stacks in the inventory matching the given material. *