2012-02-09 12:11:18 +01:00
|
|
|
package com.gmail.nossr50.runnables;
|
|
|
|
|
|
|
|
import org.bukkit.entity.Player;
|
|
|
|
|
2012-06-06 20:49:07 +02:00
|
|
|
import com.gmail.nossr50.McMMO;
|
2012-02-09 12:11:18 +01:00
|
|
|
|
2012-04-27 11:47:11 +02:00
|
|
|
public class SaveTimer implements Runnable {
|
2012-06-06 20:49:07 +02:00
|
|
|
private final McMMO plugin;
|
2012-04-01 06:11:57 +02:00
|
|
|
|
2012-06-06 20:49:07 +02:00
|
|
|
public SaveTimer(final McMMO plugin) {
|
2012-02-09 12:11:18 +01:00
|
|
|
this.plugin = plugin;
|
|
|
|
}
|
2012-04-01 06:11:57 +02:00
|
|
|
|
2012-03-11 04:21:53 +01:00
|
|
|
@Override
|
2012-04-01 06:11:57 +02:00
|
|
|
public void run() {
|
2012-02-09 17:26:57 +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
|
|
|
|
2012-04-01 06:11:57 +02:00
|
|
|
for (Player player : plugin.getServer().getOnlinePlayers()) {
|
2012-04-30 04:58:54 +02:00
|
|
|
plugin.getServer().getScheduler().scheduleSyncDelayedTask(plugin, new ProfileSaveTask(player), count);
|
2012-04-29 21:02:24 +02:00
|
|
|
count++;
|
2012-02-09 17:26:57 +01:00
|
|
|
}
|
|
|
|
}
|
2012-04-01 06:11:57 +02:00
|
|
|
}
|