Prevent ArrayIndexOutOfBoundsException #17

Open
import_user_oitsjustjose_95mQ wants to merge 1 commit from github/fork/Kraise/master into master
Showing only changes of commit 33edbfafed - Show all commits

Prevent ArrayIndexOutOfBoundsException on Render

Tiny fix to ensure the icon ID is always within the correct bounds, to prevent crashes.
Kraise_ 2016-08-12 19:51:07 +01:00 • committed by GitHub

View file

@ -33,7 +33,7 @@ public class ItemBushFruit extends ItemFood {
@Override
@SideOnly(Side.CLIENT)
public Icon getIconFromDamage(int meta) {
int j = MathHelper.clamp_int(meta, 0, FRUIT_TYPES.length);
int j = MathHelper.clamp_int(meta, 0, FRUIT_TYPES.length - 1);
return icons[j];
}