2012-02-09 12:11:18 +01:00
|
|
|
package com.gmail.nossr50.runnables;
|
|
|
|
|
2013-03-20 08:11:16 +01:00
|
|
|
import org.bukkit.scheduler.BukkitRunnable;
|
2012-02-09 12:11:18 +01:00
|
|
|
|
2012-06-07 00:02:22 +02:00
|
|
|
import com.gmail.nossr50.mcMMO;
|
2013-03-01 06:52:01 +01:00
|
|
|
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
|
2012-06-08 23:48:41 +02:00
|
|
|
import com.gmail.nossr50.party.PartyManager;
|
2013-03-01 06:52:01 +01:00
|
|
|
import com.gmail.nossr50.runnables.player.PlayerProfileSaveTask;
|
|
|
|
import com.gmail.nossr50.util.player.UserManager;
|
2012-02-09 12:11:18 +01:00
|
|
|
|
2013-03-20 08:11:16 +01:00
|
|
|
public class SaveTimerTask extends BukkitRunnable {
|
2012-03-11 04:21:53 +01:00
|
|
|
@Override
|
2012-04-01 06:11:57 +02:00
|
|
|
public void run() {
|
2013-03-01 06:52:01 +01:00
|
|
|
// All player data will be saved periodically through this
|
2012-04-29 21:02:24 +02:00
|
|
|
int count = 1;
|
2012-04-30 04:58:54 +02:00
|
|
|
|
2013-07-15 15:14:23 +02:00
|
|
|
for (McMMOPlayer mcMMOPlayer : UserManager.getPlayers()) {
|
2013-11-17 02:22:18 +01:00
|
|
|
new PlayerProfileSaveTask(mcMMOPlayer.getProfile()).runTaskLaterAsynchronously(mcMMO.p, count);
|
2012-04-29 21:02:24 +02:00
|
|
|
count++;
|
2012-02-09 17:26:57 +01:00
|
|
|
}
|
2012-06-08 23:48:41 +02:00
|
|
|
|
2013-01-26 23:01:55 +01:00
|
|
|
PartyManager.saveParties();
|
2012-02-09 17:26:57 +01:00
|
|
|
}
|
2012-04-01 06:11:57 +02:00
|
|
|
}
|