From b47d44ce6386984345b5601da732775861f8f1c3 Mon Sep 17 00:00:00 2001 From: NotAPenguin Date: Tue, 17 Sep 2024 16:44:03 +0200 Subject: Fix GT++ index out of bounds (#3214) Co-authored-by: Martin Robertz --- .../gtPlusPlus/xmod/gregtech/loaders/recipe/RecipeLoaderAlgaeFarm.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/main/java/gtPlusPlus/xmod/gregtech/loaders') diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/recipe/RecipeLoaderAlgaeFarm.java b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/recipe/RecipeLoaderAlgaeFarm.java index d5fe301173..4689bb5042 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/recipe/RecipeLoaderAlgaeFarm.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/recipe/RecipeLoaderAlgaeFarm.java @@ -45,7 +45,7 @@ public class RecipeLoaderAlgaeFarm { aTemp.add(generateBaseRecipe(aCompost, aTier)); } } - int aIndex = MathUtils.randInt(0, aTemp.isEmpty() ? 1 : aTemp.size()); + int aIndex = MathUtils.randInt(0, (aTemp.isEmpty() ? 1 : aTemp.size()) - 1); Logger.INFO("Using recipe with index of " + aIndex + ". " + aComp); return aTemp.get(aIndex); } -- cgit