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.
This commit is contained in:
parent
1c0deadfc6
commit
23005b3cd4
|
@ -91,7 +91,7 @@ public class NEIAlchemyRecipeHandler extends TemplateRecipeHandler {
|
||||||
}
|
}
|
||||||
|
|
||||||
ArrayList<ItemStack> orbs = new ArrayList<ItemStack>();
|
ArrayList<ItemStack> orbs = new ArrayList<ItemStack>();
|
||||||
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));
|
ItemStack orb = new ItemStack(bloodOrbs.get(i - 1));
|
||||||
if(NEIServerUtils.areStacksSameTypeCrafting(orb, ingredient)) {
|
if(NEIServerUtils.areStacksSameTypeCrafting(orb, ingredient)) {
|
||||||
arecipes.add(new CachedAlchemyRecipe(recipe));
|
arecipes.add(new CachedAlchemyRecipe(recipe));
|
||||||
|
|
Loading…
Reference in a new issue