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
+10
View File
@@ -297,6 +297,7 @@ public class CraftingGridCache implements ICraftingGrid, ICraftingProviderHelper
// erase list.
craftingMethods.clear();
craftableItems.clear();
emitableItems.clear();
// re-create list..
for (ICraftingProvider cp : providers)
@@ -375,6 +376,9 @@ public class CraftingGridCache implements ICraftingGrid, ICraftingProviderHelper
for (IAEItemStack st : craftableItems.keySet())
out.addCrafting( st );
for (IAEItemStack st : emitableItems)
out.addCrafting( st );
return out;
}
@@ -568,4 +572,10 @@ public class CraftingGridCache implements ICraftingGrid, ICraftingProviderHelper
return emitableItems.contains( what );
}
@Override
public void setEmitable(IAEItemStack what)
{
emitableItems.add( what.copy() );
}
}
@@ -684,6 +684,7 @@ public class CraftingCPUCluster implements IAECluster, ICraftingCPU
IAEItemStack cItem = AEItemStack.create( output );
postChange( cItem, machineSrc );
waitingFor.add( cItem );
postCraftingStatusChange( cItem );
}
}
}
@@ -791,6 +792,7 @@ public class CraftingCPUCluster implements IAECluster, ICraftingCPU
IItemList<IAEItemStack> list;
getListOfItem( list = AEApi.instance().storage().createItemList(), CraftingItemList.ALL );
for (IAEItemStack ge : list)
postChange( ge, machineSrc );
@@ -853,6 +855,12 @@ public class CraftingCPUCluster implements IAECluster, ICraftingCPU
inventory.injectItems( extractItems, Actionable.MODULATE, null );
}
public void addEmitable(IAEItemStack i)
{
waitingFor.add( i );
postCraftingStatusChange( i );
}
public void addCrafting(ICraftingPatternDetails details, long crafts)
{
TaskProgress i = tasks.get( details );
@@ -950,6 +958,8 @@ public class CraftingCPUCluster implements IAECluster, ICraftingCPU
}
waitingFor = readList( (NBTTagList) data.getTag( "waitingFor" ) );
for (IAEItemStack is : waitingFor)
postCraftingStatusChange( is.copy() );
}
public void writeToNBT(NBTTagCompound data)
@@ -1066,7 +1076,8 @@ public class CraftingCPUCluster implements IAECluster, ICraftingCPU
public boolean isMaking(IAEItemStack what)
{
return waitingFor.findPrecise( what ) != null;
IAEItemStack wat = waitingFor.findPrecise( what );
return wat != null && wat.getStackSize() > 0;
}
}