diff --git a/src/main/java/com/pahimar/ee3/exchange/WrappedStack.java b/src/main/java/com/pahimar/ee3/exchange/WrappedStack.java index 645c3289..f9dcf609 100644 --- a/src/main/java/com/pahimar/ee3/exchange/WrappedStack.java +++ b/src/main/java/com/pahimar/ee3/exchange/WrappedStack.java @@ -106,11 +106,18 @@ public class WrappedStack implements Comparable if (object instanceof ItemStack) { - ItemStack itemStack = ((ItemStack) object).copy(); - - stackSize = itemStack.stackSize; - itemStack.stackSize = 1; - wrappedStack = itemStack; + if (((ItemStack) object).getItem() != null) + { + ItemStack itemStack = ((ItemStack) object).copy(); + stackSize = itemStack.stackSize; + itemStack.stackSize = 1; + wrappedStack = itemStack; + } + else + { + stackSize = -1; + wrappedStack = null; + } } else if (object instanceof OreStack) { @@ -259,10 +266,17 @@ public class WrappedStack implements Comparable { return true; } - else if (object instanceof Item || object instanceof Block || object instanceof ItemStack) + else if (object instanceof Item || object instanceof Block) { return true; } + else if (object instanceof ItemStack) + { + if (((ItemStack)object).getItem() != null) + { + return true; + } + } else if (object instanceof OreStack) { return true;