From 188210f020c446c6be4f2875cc050793dbbf1964 Mon Sep 17 00:00:00 2001 From: Sollace Date: Sat, 17 Sep 2022 20:51:38 +0200 Subject: [PATCH] Fix crash when calling the recipe tree builder with one input --- .../unicopia/client/gui/spellbook/IngredientTree.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/minelittlepony/unicopia/client/gui/spellbook/IngredientTree.java b/src/main/java/com/minelittlepony/unicopia/client/gui/spellbook/IngredientTree.java index 90a6cb1b..96a983b5 100644 --- a/src/main/java/com/minelittlepony/unicopia/client/gui/spellbook/IngredientTree.java +++ b/src/main/java/com/minelittlepony/unicopia/client/gui/spellbook/IngredientTree.java @@ -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;