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

51 lines
1.3 KiB
Java
Raw Normal View History

package com.massivecraft.factions.task;
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;
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;
public class TaskEconLandReward extends ModuloRepeatTask
{
// -------------------------------------------- //
// INSTANCE & CONSTRUCT
// -------------------------------------------- //
private static TaskEconLandReward i = new TaskEconLandReward();
public static TaskEconLandReward get() { return i; }
// -------------------------------------------- //
// OVERRIDE: MODULO REPEAT TASK
// -------------------------------------------- //
2015-01-19 09:58:25 +01:00
@Override
public Plugin getPlugin()
{
return Factions.get();
}
@Override
public long getDelayMillis()
{
return (long) (MConf.get().taskEconLandRewardMinutes * TimeUnit.MILLIS_PER_MINUTE);
}
@Override
public void setDelayMillis(long delayMillis)
{
MConf.get().taskEconLandRewardMinutes = delayMillis / (double) TimeUnit.MILLIS_PER_MINUTE;
}
@Override
2013-04-24 08:59:43 +02:00
public void invoke(long now)
{
2015-12-15 13:57:58 +01:00
if ( ! MassiveCore.isTaskServer()) return;
FactionColl.get().econLandRewardRoutine();
}
}