check if items can be inserted in to machine before starting a CraftingStepProcess

This commit is contained in:
way2muchnoise
2016-10-23 16:19:05 +02:00
parent 121aa004e1
commit ce39f95d36

View File

@@ -291,9 +291,15 @@ public class CraftingTask implements ICraftingTask {
for (ICraftingStep otherProcessable : otherTask.getSteps()) { for (ICraftingStep otherProcessable : otherTask.getSteps()) {
if (otherProcessable.getPattern().isProcessing()) { if (otherProcessable.getPattern().isProcessing()) {
if (otherProcessable != processable && !otherProcessable.hasReceivedOutputs() && otherProcessable.hasStartedProcessing() && otherProcessable.getPattern().getContainer().getFacingTile() != null) { if (otherProcessable != processable && !otherProcessable.hasReceivedOutputs() && otherProcessable.hasStartedProcessing() && otherProcessable.getPattern().getContainer().getFacingTile() != null) {
if (!arePatternsEqual(processable.getPattern(), otherProcessable.getPattern())) {
if (processable.getPattern().getContainer().getFacingTile().getPos().equals(otherProcessable.getPattern().getContainer().getFacingTile().getPos())) { if (processable.getPattern().getContainer().getFacingTile().getPos().equals(otherProcessable.getPattern().getContainer().getFacingTile().getPos())) {
if (!arePatternsEqual(processable.getPattern(), otherProcessable.getPattern())) {
return false; return false;
} else {
for (ItemStack toInsert : processable.getToInsert()) {
if (ItemHandlerHelper.insertItem(processable.getPattern().getContainer().getFacingInventory(), toInsert, true) != null) {
return false;
}
}
} }
} }
} }