Stop when matched
This commit is contained in:
@@ -350,7 +350,9 @@ public class TileController extends TileBase implements IEnergyReceiver, INetwor
|
|||||||
|
|
||||||
for (ICraftingTask task : craftingTasks) {
|
for (ICraftingTask task : craftingTasks) {
|
||||||
if (task instanceof ProcessingCraftingTask) {
|
if (task instanceof ProcessingCraftingTask) {
|
||||||
((ProcessingCraftingTask) task).onInserted(stack);
|
if (((ProcessingCraftingTask) task).onInserted(stack)) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -58,12 +58,15 @@ public class ProcessingCraftingTask implements ICraftingTask {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onInserted(ItemStack inserted) {
|
public boolean onInserted(ItemStack inserted) {
|
||||||
for (int i = 0; i < pattern.getOutputs().length; ++i) {
|
for (int i = 0; i < pattern.getOutputs().length; ++i) {
|
||||||
if (!satisfied[i] && InventoryUtils.compareStack(inserted, pattern.getOutputs()[i])) {
|
if (!satisfied[i] && InventoryUtils.compareStack(inserted, pattern.getOutputs()[i])) {
|
||||||
satisfied[i] = true;
|
satisfied[i] = true;
|
||||||
|
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
Reference in New Issue
Block a user