Factions/src/com/massivecraft/factions/task/EconRewardTask.java

44 lines
1.1 KiB
Java
Raw Normal View History

package com.massivecraft.factions.task;
2013-04-09 13:15:25 +02:00
import com.massivecraft.factions.ConfServer;
2013-04-22 09:37:53 +02:00
import com.massivecraft.factions.entity.FactionColl;
import com.massivecraft.factions.entity.FactionColls;
import com.massivecraft.mcore.ModuloRepeatTask;
import com.massivecraft.mcore.util.TimeUnit;
2013-04-23 12:14:36 +02:00
public class EconRewardTask extends ModuloRepeatTask
{
// -------------------------------------------- //
// INSTANCE & CONSTRUCT
// -------------------------------------------- //
2013-04-23 12:14:36 +02:00
private static EconRewardTask i = new EconRewardTask();
public static EconRewardTask get() { return i; }
// -------------------------------------------- //
// OVERRIDE: MODULO REPEAT TASK
// -------------------------------------------- //
@Override
public long getDelayMillis()
{
return (long) (ConfServer.econLandRewardTaskRunsEveryXMinutes * TimeUnit.MILLIS_PER_MINUTE);
}
@Override
public void setDelayMillis(long delayMillis)
{
throw new RuntimeException("operation not supported");
}
@Override
public void invoke()
{
for (FactionColl coll : FactionColls.get().getColls())
{
coll.econLandRewardRoutine();
}
}
}