Skip to content

Commit

Permalink
Fixed ArrayIndexOutOfBoundsException on DiamondApple getUnlocalizedNa…
Browse files Browse the repository at this point in the history
…me(); compressed to max
  • Loading branch information
CandiceJoy committed Aug 2, 2015
1 parent 23d81ba commit 9a33c60
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions src/main/java/tconstruct/armor/items/DiamondApple.java
Expand Up @@ -75,14 +75,6 @@ public void registerIcons (IIconRegister iconRegister)
@Override
public String getUnlocalizedName (ItemStack itemstack)
{
int damage = itemstack.getItemDamage();
int name_index = damage;

if( name_index < 0 || name_index >= itemNames.length )
{
name_index = 0;
}

return (new StringBuilder()).append("item.food.").append(itemNames[name_index]).toString();
return (new StringBuilder()).append("item.food.").append(itemNames[(itemstack.getItemDamage()>=itemNames.length||itemstack.getItemDamage()<0)?(0):(itemstack.getItemDamage())]).toString();
}
}

0 comments on commit 9a33c60

Please sign in to comment.