From 438f5121b5c158c6033b0e6b331c8bc276be0921 Mon Sep 17 00:00:00 2001 From: pahimar Date: Fri, 8 May 2015 08:14:49 -0400 Subject: [PATCH] Fixes #827 --- .../com/pahimar/ee3/exchange/WrappedStack.java | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/pahimar/ee3/exchange/WrappedStack.java b/src/main/java/com/pahimar/ee3/exchange/WrappedStack.java index d3fc6fae..93a80c25 100644 --- a/src/main/java/com/pahimar/ee3/exchange/WrappedStack.java +++ b/src/main/java/com/pahimar/ee3/exchange/WrappedStack.java @@ -583,13 +583,23 @@ public class WrappedStack implements Comparable, 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)