diff options
author | NotAPenguin <michiel.vandeginste@gmail.com> | 2024-09-17 16:44:03 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-09-17 14:44:03 +0000 |
commit | b47d44ce6386984345b5601da732775861f8f1c3 (patch) | |
tree | 8c98b38e5b2e96ee6b98b03c5ea049a537f3c4c4 | |
parent | dfa65c81e3218af26cb3db8f1c61919beb46bf30 (diff) | |
download | GT5-Unofficial-b47d44ce6386984345b5601da732775861f8f1c3.tar.gz GT5-Unofficial-b47d44ce6386984345b5601da732775861f8f1c3.tar.bz2 GT5-Unofficial-b47d44ce6386984345b5601da732775861f8f1c3.zip |
Fix GT++ index out of bounds (#3214)
Co-authored-by: Martin Robertz <dream-master@gmx.net>
-rw-r--r-- | src/main/java/gtPlusPlus/xmod/gregtech/loaders/recipe/RecipeLoaderAlgaeFarm.java | 2 |
1 files changed, 1 insertions, 1 deletions
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); } |