2012-11-28 06:51:37 +01:00
|
|
|
package com.massivecraft.factions.util;
|
|
|
|
|
2013-04-09 13:15:25 +02:00
|
|
|
import com.massivecraft.factions.ConfServer;
|
2013-04-09 12:58:39 +02:00
|
|
|
import com.massivecraft.factions.FactionColl;
|
2013-04-09 13:00:09 +02:00
|
|
|
import com.massivecraft.factions.Factions;
|
2012-11-28 06:51:37 +01:00
|
|
|
|
2013-04-10 09:47:32 +02:00
|
|
|
public class EconLandRewardTask implements Runnable
|
|
|
|
{
|
2012-11-28 06:51:37 +01:00
|
|
|
double rate;
|
|
|
|
|
|
|
|
public EconLandRewardTask()
|
|
|
|
{
|
2013-04-09 13:15:25 +02:00
|
|
|
this.rate = ConfServer.econLandRewardTaskRunsEveryXMinutes;
|
2012-11-28 06:51:37 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void run()
|
|
|
|
{
|
2013-04-12 09:47:43 +02:00
|
|
|
FactionColl.get().econLandRewardRoutine();
|
2013-04-10 09:47:32 +02:00
|
|
|
|
|
|
|
// TODO: This technique is TPS dependent and wrong.
|
|
|
|
// Instead of restarting a TPS dependent task the task should poll every once in a while for the system millis.
|
|
|
|
// With such a setup the need for restarts are gone.
|
|
|
|
|
2012-11-28 06:51:37 +01:00
|
|
|
// maybe setting has been changed? if so, restart task at new rate
|
2013-04-09 13:15:25 +02:00
|
|
|
if (this.rate != ConfServer.econLandRewardTaskRunsEveryXMinutes)
|
2013-04-10 09:47:32 +02:00
|
|
|
{
|
2013-04-09 13:12:13 +02:00
|
|
|
Factions.get().startEconLandRewardTask(true);
|
2013-04-10 09:47:32 +02:00
|
|
|
}
|
2012-11-28 06:51:37 +01:00
|
|
|
}
|
|
|
|
}
|