Fix crash when calling the recipe tree builder with one input

This commit is contained in:
Sollace 2022-09-17 20:51:38 +02:00
parent af7e19ae69
commit 188210f020

View file

@ -84,7 +84,7 @@ class IngredientTree implements SpellbookRecipe.CraftingTreeBuilder {
int colWidth = 22;
int rowHeight = 20;
int cols = width / colWidth - 1;
int cols = Math.max(1, width / colWidth - 1);
int rows = Math.max(1, (int)Math.ceil((float)entries.size() / cols));
int totalHeight = rowHeight * rows;