Search in sources :

Example 1 with PoweredTask

use of crazypants.enderio.base.machine.task.PoweredTask in project EnderIO by SleepyTrousers.

the class TilePoweredSpawner method createTask.

@Override
protected IPoweredTask createTask(@Nonnull IMachineRecipe nextRecipe, long nextSeed) {
    PoweredTask res = new PoweredTask(nextRecipe, nextSeed, getRecipeInputs());
    int ticksDelay;
    if (isSpawnMode) {
        ticksDelay = SpawnerConfig.poweredSpawnerMinDelayTicks.get() + (int) Math.round((SpawnerConfig.poweredSpawnerMaxDelayTicks.get() - SpawnerConfig.poweredSpawnerMinDelayTicks.get()) * Math.random());
    } else {
        ticksDelay = SpawnerConfig.poweredSpawnerMaxDelayTicks.get() - ((SpawnerConfig.poweredSpawnerMaxDelayTicks.get() - SpawnerConfig.poweredSpawnerMinDelayTicks.get()) / 2);
    }
    ticksDelay /= SPAWNER_SPEEDUP.getFloat(getCapacitorData());
    int powerPerTick = getPowerUsePerTick();
    res.setRequiredEnergy(powerPerTick * ticksDelay);
    return res;
}
Also used : PoweredTask(crazypants.enderio.base.machine.task.PoweredTask) IPoweredTask(crazypants.enderio.base.machine.interfaces.IPoweredTask)

Example 2 with PoweredTask

use of crazypants.enderio.base.machine.task.PoweredTask in project EnderIO by SleepyTrousers.

the class TileSagMill method createTask.

@Override
protected IPoweredTask createTask(@Nonnull IMachineRecipe nextRecipe, long nextSeed) {
    PoweredTask res;
    if (grindingBall != null && nextRecipe.getBonusType(getRecipeInputs()).doChances()) {
        res = new PoweredTask(nextRecipe, nextSeed, grindingBall.getGrindingMultiplier(), grindingBall.getChanceMultiplier(), getRecipeInputs());
        res.setRequiredEnergy(res.getRequiredEnergy() * grindingBall.getPowerMultiplier());
    } else {
        res = new PoweredTask(nextRecipe, nextSeed, getRecipeInputs());
    }
    return res;
}
Also used : PoweredTask(crazypants.enderio.base.machine.task.PoweredTask) IPoweredTask(crazypants.enderio.base.machine.interfaces.IPoweredTask)

Aggregations

IPoweredTask (crazypants.enderio.base.machine.interfaces.IPoweredTask)2 PoweredTask (crazypants.enderio.base.machine.task.PoweredTask)2