mcMMO/src/main/java/com/gmail/nossr50/runnables/SaveTimer.java

25 lines
615 B
Java
Raw Normal View History

package com.gmail.nossr50.runnables;
import org.bukkit.entity.Player;
import com.gmail.nossr50.McMMO;
2012-04-27 11:47:11 +02:00
public class SaveTimer implements Runnable {
private final McMMO plugin;
2012-04-01 06:11:57 +02:00
public SaveTimer(final McMMO plugin) {
this.plugin = plugin;
}
2012-04-01 06:11:57 +02: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
int count = 1;
2012-04-01 06:11:57 +02:00
for (Player player : plugin.getServer().getOnlinePlayers()) {
plugin.getServer().getScheduler().scheduleSyncDelayedTask(plugin, new ProfileSaveTask(player), count);
count++;
2012-02-09 17:26:57 +01:00
}
}
2012-04-01 06:11:57 +02:00
}