fix index error

This commit is contained in:
jascotty2 2019-09-30 18:54:09 -05:00
parent 4b86dd16ee
commit 5ce5fc7a26

View File

@ -60,7 +60,7 @@ public class OverviewGui extends Gui {
// enable page events
if (level.getPages() > 1) {
this.pages = level.getPages();
setPages(level.getPages());
setPrevPage(2, 0, GuiUtils.createButtonItem(CompatibleMaterial.ARROW, plugin.getLocale().getMessage("general.interface.previous").getMessage()));
setNextPage(2, 8, GuiUtils.createButtonItem(CompatibleMaterial.ARROW, plugin.getLocale().getMessage("general.interface.next").getMessage()));
setOnPage((event) -> updateInventory());
@ -171,7 +171,7 @@ public class OverviewGui extends Gui {
if (item != null && item.getType() != Material.AIR)
items.add(item);
} else {
if (i > farm.getItems().size())
if (i >= farm.getItems().size())
continue;
items.add(farm.getItems().get(i));
}