2013-04-18 12:29:56 +02:00
|
|
|
package com.massivecraft.factions.task;
|
2012-11-28 06:51:37 +01:00
|
|
|
|
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;
|
2013-04-22 12:26:13 +02:00
|
|
|
import com.massivecraft.factions.entity.FactionColls;
|
2013-04-18 13:36:52 +02:00
|
|
|
import com.massivecraft.mcore.ModuloRepeatTask;
|
|
|
|
import com.massivecraft.mcore.util.TimeUnit;
|
2012-11-28 06:51:37 +01:00
|
|
|
|
2013-04-18 13:36:52 +02:00
|
|
|
public class EconLandRewardTask extends ModuloRepeatTask
|
2013-04-10 09:47:32 +02:00
|
|
|
{
|
2013-04-18 13:36:52 +02:00
|
|
|
// -------------------------------------------- //
|
|
|
|
// INSTANCE & CONSTRUCT
|
|
|
|
// -------------------------------------------- //
|
2012-11-28 06:51:37 +01:00
|
|
|
|
2013-04-18 13:36:52 +02:00
|
|
|
private static EconLandRewardTask i = new EconLandRewardTask();
|
|
|
|
public static EconLandRewardTask get() { return i; }
|
|
|
|
|
|
|
|
// -------------------------------------------- //
|
|
|
|
// OVERRIDE: MODULO REPEAT TASK
|
|
|
|
// -------------------------------------------- //
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public long getDelayMillis()
|
2012-11-28 06:51:37 +01:00
|
|
|
{
|
2013-04-18 13:36:52 +02:00
|
|
|
return (long) (ConfServer.econLandRewardTaskRunsEveryXMinutes * TimeUnit.MILLIS_PER_MINUTE);
|
2012-11-28 06:51:37 +01:00
|
|
|
}
|
2013-04-18 13:36:52 +02:00
|
|
|
|
2012-11-28 06:51:37 +01:00
|
|
|
@Override
|
2013-04-18 13:36:52 +02:00
|
|
|
public void setDelayMillis(long delayMillis)
|
|
|
|
{
|
|
|
|
throw new RuntimeException("operation not supported");
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void invoke()
|
2012-11-28 06:51:37 +01:00
|
|
|
{
|
2013-04-22 12:26:13 +02:00
|
|
|
for (FactionColl coll : FactionColls.get().getColls())
|
|
|
|
{
|
|
|
|
coll.econLandRewardRoutine();
|
|
|
|
}
|
2012-11-28 06:51:37 +01:00
|
|
|
}
|
2013-04-18 13:36:52 +02:00
|
|
|
|
2012-11-28 06:51:37 +01:00
|
|
|
}
|