Fixed bug where panel size was incorrectly set.

Slot position is not the same as size. Size is slot + 1.
This commit is contained in:
tastybento 2018-08-31 05:45:18 +09:00
parent d0ddf3d9bc
commit 0da7c0bb3c

View File

@ -94,6 +94,7 @@ public class PanelBuilder {
* @return Panel * @return Panel
*/ */
public Panel build() { 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);
} }
} }