Fixes next arrow showing when there is nothing on next page

https://github.com/BentoBoxWorld/BentoBox/issues/904
This commit is contained in:
tastybento 2019-08-18 18:13:14 -07:00
parent c764444fa5
commit b4d662843b

View File

@ -104,7 +104,7 @@ public class TabbedPanel extends Panel implements PanelListener {
return true;
}).build());
}
if ((page + 1) * 45 < items.size()) {
if ((page + 1) * 43L < panelItems.stream().filter(Objects::nonNull).count()) {
// Next page icon
items.put(items.lastKey() + 1, new PanelItemBuilder().icon(Material.ARROW).name(tpb.getUser().getTranslation(PROTECTION_PANEL + "next")).clickHandler((panel, user1, clickType, slot1) -> {
this.activePage++;