int setsAbleToCraft = calculateMaxWork(setsToCraft); // Deliberately outside the 0 check, because calling generatePromies(0) here clears the old ones.
if(setsAbleToCraft>0) { // sanity check, as creating 0 sized promises is an exception. This should never be hit.
//LogisticsPipes.log.info("crafting : " + setsToCraft + "sets of " + treeNode.getStack().getItem().getFriendlyName());
//if we got here, we can at least some of the remaining amount
LogisticsPromise job = template.generatePromise(setsAbleToCraft);
if(job.numberOfItems!=setsAbleToCraft*this.setSize)
throw new IllegalStateException("generatePromises not creating the promisesPromised; this is goign to end badly.");
treeNode.addPromise(job);
} else {
//stacksOfWorkRequested=0; // just incase we call it twice.