Fixed an error with give stack being null
All though this caused no crash it was still an issue
This commit is contained in:
parent
0b64248a5a
commit
934814cfbf
1 changed files with 9 additions and 6 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue