From 23005b3cd40249a78293d51cb7efcc65fa81cd72 Mon Sep 17 00:00:00 2001 From: joshiejack Date: Mon, 2 Jun 2014 11:18:17 +0100 Subject: [PATCH] Fixing potential arrayoutofbounds exception I don't care if someone sets a recipe with an orb level greater than the max, that's their fault, but if they accidentally set one to 'tier 0', i don't think nei should crash. --- .../joshie/alchemicalWizardy/nei/NEIAlchemyRecipeHandler.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/BM_src/joshie/alchemicalWizardy/nei/NEIAlchemyRecipeHandler.java b/BM_src/joshie/alchemicalWizardy/nei/NEIAlchemyRecipeHandler.java index b21ec47c..13fa27c1 100644 --- a/BM_src/joshie/alchemicalWizardy/nei/NEIAlchemyRecipeHandler.java +++ b/BM_src/joshie/alchemicalWizardy/nei/NEIAlchemyRecipeHandler.java @@ -91,7 +91,7 @@ public class NEIAlchemyRecipeHandler extends TemplateRecipeHandler { } ArrayList orbs = new ArrayList(); - for(int i = recipe.getOrbLevel(); i <= bloodOrbs.size(); i++) { + for(int i = Math.max(0, recipe.getOrbLevel()); i <= bloodOrbs.size(); i++) { ItemStack orb = new ItemStack(bloodOrbs.get(i - 1)); if(NEIServerUtils.areStacksSameTypeCrafting(orb, ingredient)) { arecipes.add(new CachedAlchemyRecipe(recipe));