From 4626646292fc10aed4ade98e9d25c52e6f827572 Mon Sep 17 00:00:00 2001 From: Ruakij Date: Tue, 11 May 2021 12:41:09 +0200 Subject: [PATCH] Implemented config-option autosave --- .../java/eu/ruekov/ruakij/LinkedBeaconTeleporters/Main.java | 2 +- src/main/resources/config.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/eu/ruekov/ruakij/LinkedBeaconTeleporters/Main.java b/src/main/java/eu/ruekov/ruakij/LinkedBeaconTeleporters/Main.java index 169aa4d..f1bd4b8 100644 --- a/src/main/java/eu/ruekov/ruakij/LinkedBeaconTeleporters/Main.java +++ b/src/main/java/eu/ruekov/ruakij/LinkedBeaconTeleporters/Main.java @@ -91,8 +91,8 @@ public class Main extends JavaPlugin { } } - static int autosaveInterval = 600 * 20; static void initAutoSave(){ + int autosaveInterval = config.getInt("config.interval")*20; Bukkit.getScheduler().scheduleSyncRepeatingTask(plugin, () -> { saveData(); diff --git a/src/main/resources/config.yml b/src/main/resources/config.yml index 9013eba..3ce29c6 100644 --- a/src/main/resources/config.yml +++ b/src/main/resources/config.yml @@ -19,6 +19,6 @@ locationCheck: # TODO # 5 (= 4 times/s) is usually responsive enough for most interactions interval: 5 -autosave: # TODO +autosave: # Interval [in seconds] for autosave interval: 600 \ No newline at end of file