2013-04-18 12:29:56 +02:00
|
|
|
package com.massivecraft.factions.task;
|
2012-02-26 23:55:58 +01:00
|
|
|
|
2013-04-24 08:39:26 +02:00
|
|
|
import com.massivecraft.factions.entity.MConf;
|
2014-09-17 13:17:33 +02:00
|
|
|
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;
|
2012-02-26 23:55:58 +01:00
|
|
|
|
2013-04-24 08:45:52 +02:00
|
|
|
public class TaskPlayerDataRemove extends ModuloRepeatTask
|
2012-02-26 23:55:58 +01:00
|
|
|
{
|
2013-04-18 13:36:52 +02:00
|
|
|
// -------------------------------------------- //
|
|
|
|
// INSTANCE & CONSTRUCT
|
|
|
|
// -------------------------------------------- //
|
|
|
|
|
2013-04-24 08:45:52 +02:00
|
|
|
private static TaskPlayerDataRemove i = new TaskPlayerDataRemove();
|
|
|
|
public static TaskPlayerDataRemove get() { return i; }
|
2013-04-18 13:36:52 +02:00
|
|
|
|
|
|
|
// -------------------------------------------- //
|
|
|
|
// OVERRIDE: MODULO REPEAT TASK
|
|
|
|
// -------------------------------------------- //
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public long getDelayMillis()
|
2012-02-26 23:55:58 +01:00
|
|
|
{
|
2013-04-24 08:45:52 +02:00
|
|
|
return (long) (MConf.get().taskPlayerDataRemoveMinutes * TimeUnit.MILLIS_PER_MINUTE);
|
2012-02-26 23:55:58 +01:00
|
|
|
}
|
2013-04-18 13:36:52 +02:00
|
|
|
|
|
|
|
@Override
|
|
|
|
public void setDelayMillis(long delayMillis)
|
|
|
|
{
|
2013-04-24 08:45:52 +02:00
|
|
|
MConf.get().taskPlayerDataRemoveMinutes = 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-02-26 23:55:58 +01:00
|
|
|
{
|
2014-10-06 13:08:34 +02:00
|
|
|
MPlayerColl.get().considerRemovePlayerMillis();
|
2012-02-26 23:55:58 +01:00
|
|
|
}
|
2013-04-18 13:36:52 +02:00
|
|
|
|
2012-02-26 23:55:58 +01:00
|
|
|
}
|