Factions3/src/main/java/com/massivecraft/factions/task/TaskPlayerDataRemove.java

40 lines
1.1 KiB
Java
Raw Normal View History

package com.massivecraft.factions.task;
import com.massivecraft.factions.entity.MConf;
import com.massivecraft.factions.entity.MPlayerColl;
2014-06-04 14:02:23 +02:00
import com.massivecraft.massivecore.ModuloRepeatTask;
import com.massivecraft.massivecore.util.TimeUnit;
public class TaskPlayerDataRemove extends ModuloRepeatTask
{
// -------------------------------------------- //
// INSTANCE & CONSTRUCT
// -------------------------------------------- //
private static TaskPlayerDataRemove i = new TaskPlayerDataRemove();
public static TaskPlayerDataRemove get() { return i; }
// -------------------------------------------- //
// OVERRIDE: MODULO REPEAT TASK
// -------------------------------------------- //
@Override
public long getDelayMillis()
{
return (long) (MConf.get().taskPlayerDataRemoveMinutes * TimeUnit.MILLIS_PER_MINUTE);
}
@Override
public void setDelayMillis(long delayMillis)
{
MConf.get().taskPlayerDataRemoveMinutes = delayMillis / (double) TimeUnit.MILLIS_PER_MINUTE;
}
@Override
2013-04-24 08:59:43 +02:00
public void invoke(long now)
{
MPlayerColl.get().considerRemovePlayerMillis();
}
}