mirror of
https://github.com/Sollace/Unicopia.git
synced 2024-11-27 15:17:59 +01:00
Fix crash when calling the recipe tree builder with one input
This commit is contained in:
parent
af7e19ae69
commit
188210f020
1 changed files with 1 additions and 1 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue