Umm crafting calculation needs some thought...
This commit is contained in:
parent
734663f521
commit
e0ebec1a60
1 changed files with 23 additions and 2 deletions
|
@ -100,11 +100,26 @@ public class CraftingJob implements ICraftingParent
|
|||
}
|
||||
}
|
||||
|
||||
private void extractItems(IAEItemStack[] requirements, IMEInventory<IAEItemStack> inv, IItemList<IAEItemStack> storage2, IItemList<IAEItemStack> missing)
|
||||
private void extractItems(IAEItemStack[] requirements, IMEInventory<IAEItemStack> inv, IItemList<IAEItemStack> dest, IItemList<IAEItemStack> missing)
|
||||
{
|
||||
for (IAEItemStack is : requirements)
|
||||
{
|
||||
inv.extractItems( is, Actionable.MODULATE, jobHost.getActionSrc() );
|
||||
IAEItemStack avail = inv.extractItems( is, Actionable.MODULATE, jobHost.getActionSrc() );
|
||||
|
||||
if ( avail == null )
|
||||
{
|
||||
missing.add( is );
|
||||
continue;
|
||||
}
|
||||
|
||||
if ( avail.getStackSize() != is.getStackSize() )
|
||||
{
|
||||
IAEItemStack ais = avail.copy();
|
||||
ais.setStackSize( is.getStackSize() - avail.getStackSize() );
|
||||
missing.add( ais );
|
||||
}
|
||||
|
||||
dest.add( avail );
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -114,6 +129,12 @@ public class CraftingJob implements ICraftingParent
|
|||
for (IAEItemStack is : requirements)
|
||||
{
|
||||
IAEItemStack avail = inv.extractItems( is, Actionable.SIMULATE, jobHost.getActionSrc() );
|
||||
|
||||
if ( avail == null )
|
||||
return false;
|
||||
|
||||
if ( avail.getStackSize() != is.getStackSize() )
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
|
|
Loading…
Reference in a new issue