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

40 lines
1.1 KiB
Java

package com.massivecraft.factions.task;
import com.massivecraft.factions.entity.MConf;
import com.massivecraft.factions.entity.MPlayerColl;
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
public void invoke(long now)
{
MPlayerColl.get().considerRemovePlayerMillis();
}
}