Search in sources :

Example 1 with VanillaSmeltingRecipe

use of crazypants.enderio.base.recipe.alloysmelter.VanillaSmeltingRecipe in project EnderIO by SleepyTrousers.

the class TileAlloySmelter method canStartNextTask.

@Override
protected IMachineRecipe canStartNextTask(long nextSeed) {
    if (getMode() == Mode.FURNACE) {
        VanillaSmeltingRecipe vr = AlloyRecipeManager.getInstance().getVanillaRecipe();
        if (vr.isRecipe(getRecipeInputs())) {
            final IPoweredTask task = createTask(vr, nextSeed);
            if (task == null) {
                return null;
            }
            IMachineRecipe.ResultStack[] res = task.getCompletedResult();
            if (res.length == 0) {
                return null;
            }
            return canInsertResult(nextSeed, vr) ? vr : null;
        }
        return null;
    }
    IMachineRecipe nextRecipe = getNextRecipe();
    if (getMode() == Mode.ALLOY && nextRecipe instanceof VanillaSmeltingRecipe) {
        nextRecipe = null;
    }
    if (nextRecipe == null) {
        // no template
        return null;
    }
    // make sure we have room for the next output
    return canInsertResult(nextSeed, nextRecipe) ? nextRecipe : null;
}
Also used : IPoweredTask(crazypants.enderio.base.machine.interfaces.IPoweredTask) VanillaSmeltingRecipe(crazypants.enderio.base.recipe.alloysmelter.VanillaSmeltingRecipe) IMachineRecipe(crazypants.enderio.base.recipe.IMachineRecipe)

Aggregations

IPoweredTask (crazypants.enderio.base.machine.interfaces.IPoweredTask)1 IMachineRecipe (crazypants.enderio.base.recipe.IMachineRecipe)1 VanillaSmeltingRecipe (crazypants.enderio.base.recipe.alloysmelter.VanillaSmeltingRecipe)1