Fixed an error with give stack being null

All though this caused no crash it was still an issue
This commit is contained in:
DarkGuardsman 2013-06-22 23:00:23 -04:00
parent 0b64248a5a
commit 934814cfbf

View file

@ -70,13 +70,16 @@ public class CommandGive extends Command
while (targetIt.hasNext())
{
ItemStack insertStack = targetIt.next();
ItemStack original = insertStack.copy();
insertStack = invEx.tryPlaceInPosition(insertStack, new Vector3(targetTile), direction.getOpposite());
flag = insertStack != null && insertStack.stackSize == original.stackSize;
if (insertStack == null || insertStack.stackSize <= 0)
if (insertStack != null)
{
targetIt.remove();
break;
ItemStack original = insertStack.copy();
insertStack = invEx.tryPlaceInPosition(insertStack, new Vector3(targetTile), direction.getOpposite());
flag = insertStack != null && insertStack.stackSize == original.stackSize;
if (insertStack == null || insertStack.stackSize <= 0)
{
targetIt.remove();
break;
}
}
}
return flag;