Fixed autocrafting not giving back byproducts, fixes #390
This commit is contained in:
@@ -33,6 +33,11 @@ public interface ICraftingPattern {
|
||||
*/
|
||||
List<ItemStack> getOutputs();
|
||||
|
||||
/**
|
||||
* @return the byproducts
|
||||
*/
|
||||
List<ItemStack> getByproducts();
|
||||
|
||||
/**
|
||||
* @return the id of the factory that creates a crafting task for this pattern, as defined in the registry
|
||||
*/
|
||||
|
||||
@@ -91,6 +91,11 @@ public class CraftingPattern implements ICraftingPattern {
|
||||
return outputs;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ItemStack> getByproducts() {
|
||||
return byproducts;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getId() {
|
||||
return ItemPattern.isProcessing(stack) ? CraftingTaskFactoryProcessing.ID : CraftingTaskFactoryNormal.ID;
|
||||
|
||||
@@ -45,6 +45,11 @@ public class CraftingTaskNormal extends CraftingTask {
|
||||
network.insertItem(output, output.stackSize, false);
|
||||
}
|
||||
|
||||
for (ItemStack byproduct : pattern.getByproducts()) {
|
||||
// @TODO: Handle remainder
|
||||
network.insertItem(byproduct, byproduct.stackSize, false);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user