Add check to prevent ArrayIndexOutOfBoundsException in WandHelper, fixes #90 (and duplicate issues #80, #91, #97 and #98)

This commit is contained in:
Electroblob77
2019-01-04 20:07:02 +00:00
parent f886ebfd75
commit a7e6b2892c
@@ -107,7 +107,7 @@ public final class WandHelper {
int selectedSpell = wand.getTagCompound().getInteger(SELECTED_SPELL_KEY);
if(selectedSpell < spells.length){
if(selectedSpell >= 0 && selectedSpell < spells.length){
return spells[selectedSpell];
}
}