2013-04-18 12:29:56 +02:00
|
|
|
package com.massivecraft.factions.task;
|
2012-11-28 06:51:37 +01:00
|
|
|
|
2015-01-19 09:58:25 +01:00
|
|
|
import org.bukkit.plugin.Plugin;
|
|
|
|
|
|
|
|
import com.massivecraft.factions.Factions;
|
2013-04-22 09:37:53 +02:00
|
|
|
import com.massivecraft.factions.entity.FactionColl;
|
2013-04-24 08:39:26 +02:00
|
|
|
import com.massivecraft.factions.entity.MConf;
|
2015-12-15 13:57:58 +01:00
|
|
|
import com.massivecraft.massivecore.MassiveCore;
|
2014-06-04 14:02:23 +02:00
|
|
|
import com.massivecraft.massivecore.ModuloRepeatTask;
|
|
|
|
import com.massivecraft.massivecore.util.TimeUnit;
|
2012-11-28 06:51:37 +01:00
|
|
|
|
2013-04-24 08:45:52 +02:00
|
|
|
public class TaskEconLandReward 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-24 08:45:52 +02:00
|
|
|
private static TaskEconLandReward i = new TaskEconLandReward();
|
|
|
|
public static TaskEconLandReward get() { return i; }
|
2013-04-18 13:36:52 +02:00
|
|
|
|
|
|
|
// -------------------------------------------- //
|
|
|
|
// OVERRIDE: MODULO REPEAT TASK
|
|
|
|
// -------------------------------------------- //
|
|
|
|
|
2015-01-19 09:58:25 +01:00
|
|
|
@Override
|
|
|
|
public Plugin getPlugin()
|
|
|
|
{
|
|
|
|
return Factions.get();
|
|
|
|
}
|
|
|
|
|
2013-04-18 13:36:52 +02:00
|
|
|
@Override
|
|
|
|
public long getDelayMillis()
|
2012-11-28 06:51:37 +01:00
|
|
|
{
|
2013-04-24 08:45:52 +02:00
|
|
|
return (long) (MConf.get().taskEconLandRewardMinutes * 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)
|
|
|
|
{
|
2013-04-24 08:45:52 +02:00
|
|
|
MConf.get().taskEconLandRewardMinutes = delayMillis / (double) TimeUnit.MILLIS_PER_MINUTE;
|
2013-04-18 13:36:52 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2013-04-24 08:59:43 +02:00
|
|
|
public void invoke(long now)
|
2012-11-28 06:51:37 +01:00
|
|
|
{
|
2015-12-15 13:57:58 +01:00
|
|
|
if ( ! MassiveCore.isTaskServer()) return;
|
2014-09-17 13:17:33 +02:00
|
|
|
FactionColl.get().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
|
|
|
}
|