This commit is contained in:
pahimar 2015-05-08 08:14:49 -04:00
parent d487598aa0
commit 438f5121b5
1 changed files with 12 additions and 2 deletions

View File

@ -583,13 +583,23 @@ public class WrappedStack implements Comparable<WrappedStack>, JsonDeserializer<
if (wrappedStack instanceof ItemStack)
{
ItemStack itemStack = (ItemStack) wrappedStack;
String unlocalizedName = "";
try
{
unlocalizedName = itemStack.getUnlocalizedName();
}
catch (ArrayIndexOutOfBoundsException e)
{
unlocalizedName = "no-name";
}
if (itemStack.hasTagCompound())
{
return String.format("%sxitemStack[%s@%s:%s]", stackSize, itemStack.getUnlocalizedName(), itemStack.getItemDamage(), itemStack.getTagCompound());
return String.format("%sxitemStack[%s@%s:%s]", stackSize, unlocalizedName, itemStack.getItemDamage(), itemStack.getTagCompound());
}
else
{
return String.format("%sxitemStack[%s@%s]", stackSize, itemStack.getUnlocalizedName(), itemStack.getItemDamage());
return String.format("%sxitemStack[%s@%s]", stackSize, unlocalizedName, itemStack.getItemDamage());
}
}
else if (wrappedStack instanceof OreStack)