Finished Crafting EmitterLogic.
This commit is contained in:
@@ -34,7 +34,9 @@ public class CraftingTreeNode
|
||||
|
||||
boolean canEmit = false;
|
||||
boolean cannotUse = false;
|
||||
|
||||
long missing = 0;
|
||||
long howManyEmitted = 0;
|
||||
|
||||
CraftingJob job;
|
||||
IItemList<IAEItemStack> used = AEApi.instance().storage().createItemList();
|
||||
@@ -150,6 +152,17 @@ public class CraftingTreeNode
|
||||
}
|
||||
}
|
||||
|
||||
if ( canEmit )
|
||||
{
|
||||
IAEItemStack wat = what.copy();
|
||||
wat.setStackSize( l );
|
||||
|
||||
howManyEmitted = wat.getStackSize();
|
||||
bytes += wat.getStackSize();
|
||||
|
||||
return wat;
|
||||
}
|
||||
|
||||
exhausted = true;
|
||||
|
||||
if ( nodes.size() == 1 )
|
||||
@@ -267,6 +280,13 @@ public class CraftingTreeNode
|
||||
craftingCPUCluster.addStorage( ex );
|
||||
}
|
||||
|
||||
if ( howManyEmitted > 0 )
|
||||
{
|
||||
IAEItemStack i = what.copy();
|
||||
i.setStackSize( howManyEmitted );
|
||||
craftingCPUCluster.addEmitable( i );
|
||||
}
|
||||
|
||||
for (CraftingTreeProcess pro : nodes)
|
||||
pro.setJob( storage, craftingCPUCluster, src );
|
||||
}
|
||||
@@ -280,6 +300,13 @@ public class CraftingTreeNode
|
||||
plan.add( o );
|
||||
}
|
||||
|
||||
if ( howManyEmitted > 0 )
|
||||
{
|
||||
IAEItemStack i = what.copy();
|
||||
i.setCountRequestable( howManyEmitted );
|
||||
plan.addRequestable( i );
|
||||
}
|
||||
|
||||
for (IAEItemStack i : used)
|
||||
plan.add( i.copy() );
|
||||
|
||||
|
||||
Reference in New Issue
Block a user