Fix scheduleCraftingTask

This commit is contained in:
Raoul Van den Berge
2016-11-04 19:44:14 +01:00
parent 9bf71312fc
commit cc249f4eff
2 changed files with 6 additions and 14 deletions

View File

@@ -51,8 +51,8 @@ repositories {
}
dependencies {
deobfCompile "mezz.jei:jei_1.10.2:3.13.2.349:api"
runtime "mezz.jei:jei_1.10.2:3.13.2.349"
deobfCompile "mezz.jei:jei_1.10.2:3.13.2.353:api"
runtime "mezz.jei:jei_1.10.2:3.13.2.353"
compile "net.darkhax.tesla:Tesla:1.10.2-1.2.1.49"
compile "net.industrial-craft:industrialcraft-2:2.6.98-ex110:api"
deobfCompile "MCMultiPart:MCMultiPart:1.3.0:universal"

View File

@@ -463,37 +463,29 @@ public class TileController extends TileBase implements INetworkMaster, IEnergyR
@Override
public void scheduleCraftingTask(ItemStack stack, int toSchedule, int compare) {
int alreadyScheduled = 0;
for (ICraftingTask task : getCraftingTasks()) {
for (ItemStack output : task.getPattern().getOutputs()) {
if (API.instance().getComparer().isEqual(output, stack, compare)) {
alreadyScheduled++;
toSchedule -= output.stackSize * task.getQuantity();
}
}
}
boolean scheduled = false;
for (int i = 0; i < toSchedule - alreadyScheduled; ++i) {
if (toSchedule > 0) {
ICraftingPattern pattern = getPattern(stack, compare);
if (pattern != null) {
ICraftingTask task = createCraftingTask(stack, pattern, 1);
ICraftingTask task = createCraftingTask(stack, pattern, toSchedule);
task.calculate();
task.getMissing().clear();
addCraftingTask(task);
scheduled = true;
}
}
if (scheduled) {
markCraftingMonitorForUpdate();
}
}
}
@Override
public void rebuildPatterns() {