Finished Crafting EmitterLogic.

This commit is contained in:
AlgorithmX2
2014-08-13 00:33:13 -05:00
parent bcdc47622c
commit b82857b68f
8 changed files with 84 additions and 3 deletions
+27
View File
@@ -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() );