Skip to content

Commit

Permalink
Prevent negative pages in MenuCategoryOverview
Browse files Browse the repository at this point in the history
  • Loading branch information
WolfyScript committed Aug 23, 2022
1 parent aa57a13 commit 742633a
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ public void onUpdateAsync(GuiUpdate<CCCache> event) {
if (recipeBookCache.getPage() >= maxPages) {
recipeBookCache.setPage(0);
} else if (recipeBookCache.getPage() < 0) {
recipeBookCache.setPage(maxPages - 1);
recipeBookCache.setPage(Math.max(0, maxPages - 1));
}
for (int item = 0, i = 45 * recipeBookCache.getPage(); item < 45 && i < containers.size(); i++, item++) {
ButtonContainerRecipeBook button = (ButtonContainerRecipeBook) getCluster().getButton("recipe_book.container_" + item);
Expand Down

0 comments on commit 742633a

Please sign in to comment.