diff --git a/src/main/java/us/tastybento/bskyblock/api/panels/builders/PanelBuilder.java b/src/main/java/us/tastybento/bskyblock/api/panels/builders/PanelBuilder.java index 2c55286cc..7ed59ec74 100644 --- a/src/main/java/us/tastybento/bskyblock/api/panels/builders/PanelBuilder.java +++ b/src/main/java/us/tastybento/bskyblock/api/panels/builders/PanelBuilder.java @@ -71,10 +71,13 @@ public class PanelBuilder { /** * Get the next free slot number - * @return next slot number + * @return next slot number, or -1 in case none has been found. */ public int nextSlot() { - return items.isEmpty() ? 0 : items.lastKey() + 1; + for (int i = 0 ; i < (size == 0 ? 54 : size) ; i++) { + if (!slotOccupied(i)) return i; + } + return -1; } /**