From 0da7c0bb3c9e4e9863687f0c34494a28dc5fe490 Mon Sep 17 00:00:00 2001 From: tastybento Date: Fri, 31 Aug 2018 05:45:18 +0900 Subject: [PATCH] Fixed bug where panel size was incorrectly set. Slot position is not the same as size. Size is slot + 1. --- .../bentobox/bentobox/api/panels/builders/PanelBuilder.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/world/bentobox/bentobox/api/panels/builders/PanelBuilder.java b/src/main/java/world/bentobox/bentobox/api/panels/builders/PanelBuilder.java index 6234542cb..424129b88 100644 --- a/src/main/java/world/bentobox/bentobox/api/panels/builders/PanelBuilder.java +++ b/src/main/java/world/bentobox/bentobox/api/panels/builders/PanelBuilder.java @@ -94,6 +94,7 @@ public class PanelBuilder { * @return Panel */ public Panel build() { - return new Panel(name, items, Math.max(size, items.isEmpty() ? size : items.lastKey()), user, listener); + // items.lastKey() is a slot position, so the panel size is this value + 1 + return new Panel(name, items, Math.max(size, items.isEmpty() ? size : items.lastKey() + 1), user, listener); } }