Implemented config-option autosave

master
Ruakij 4 years ago
parent e82de277ef
commit 4626646292

@ -91,8 +91,8 @@ public class Main extends JavaPlugin {
} }
} }
static int autosaveInterval = 600 * 20;
static void initAutoSave(){ static void initAutoSave(){
int autosaveInterval = config.getInt("config.interval")*20;
Bukkit.getScheduler().scheduleSyncRepeatingTask(plugin, () -> { Bukkit.getScheduler().scheduleSyncRepeatingTask(plugin, () -> {
saveData(); saveData();

@ -19,6 +19,6 @@ locationCheck: # TODO
# 5 (= 4 times/s) is usually responsive enough for most interactions # 5 (= 4 times/s) is usually responsive enough for most interactions
interval: 5 interval: 5
autosave: # TODO autosave:
# Interval [in seconds] for autosave # Interval [in seconds] for autosave
interval: 600 interval: 600
Loading…
Cancel
Save