mirror of
https://github.com/GTNewHorizons/TinkersConstruct.git
synced 2026-11-22 05:02:39 +00:00
Fixed ArrayIndexOutOfBoundsException on DiamondApple getUnlocalizedName(); compressed to max
This commit is contained in:
1 parent
23d81ba1ed
commit
9a33c60d20
1 file changed
+1
-9
@@ -75,14 +75,6 @@ public class DiamondApple extends ItemFood
|
||||
@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();
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user