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;
}
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;
}
Aggregations