Merge pull request #711 from Dynious/nullItemFix

Fixes #705
This commit is contained in:
Pahimar 2014-07-21 11:28:37 -04:00
commit f11b700704

View file

@ -106,11 +106,18 @@ public class WrappedStack implements Comparable<WrappedStack>
if (object instanceof ItemStack) if (object instanceof ItemStack)
{ {
ItemStack itemStack = ((ItemStack) object).copy(); if (((ItemStack) object).getItem() != null)
{
stackSize = itemStack.stackSize; ItemStack itemStack = ((ItemStack) object).copy();
itemStack.stackSize = 1; stackSize = itemStack.stackSize;
wrappedStack = itemStack; itemStack.stackSize = 1;
wrappedStack = itemStack;
}
else
{
stackSize = -1;
wrappedStack = null;
}
} }
else if (object instanceof OreStack) else if (object instanceof OreStack)
{ {
@ -259,10 +266,17 @@ public class WrappedStack implements Comparable<WrappedStack>
{ {
return true; return true;
} }
else if (object instanceof Item || object instanceof Block || object instanceof ItemStack) else if (object instanceof Item || object instanceof Block)
{ {
return true; return true;
} }
else if (object instanceof ItemStack)
{
if (((ItemStack)object).getItem() != null)
{
return true;
}
}
else if (object instanceof OreStack) else if (object instanceof OreStack)
{ {
return true; return true;