From 087ed7d19aed68ba332ed0be7f4f72058c0abb06 Mon Sep 17 00:00:00 2001 From: Auxilor Date: Thu, 28 Oct 2021 16:40:45 +0100 Subject: [PATCH] Added option to set autosave interval --- .../src/main/java/com/willfp/ecoskills/EcoSkillsPlugin.java | 6 +++++- eco-core/core-plugin/src/main/resources/config.yml | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/eco-core/core-plugin/src/main/java/com/willfp/ecoskills/EcoSkillsPlugin.java b/eco-core/core-plugin/src/main/java/com/willfp/ecoskills/EcoSkillsPlugin.java index c5c969c..bc4c149 100644 --- a/eco-core/core-plugin/src/main/java/com/willfp/ecoskills/EcoSkillsPlugin.java +++ b/eco-core/core-plugin/src/main/java/com/willfp/ecoskills/EcoSkillsPlugin.java @@ -78,7 +78,11 @@ public class EcoSkillsPlugin extends EcoPlugin { } SaveHandler.Companion.save(this); - this.getScheduler().runTimer(new SaveHandler.Runnable(this), 20000, 20000); + this.getScheduler().runTimer( + new SaveHandler.Runnable(this), + this.getConfigYml().getInt("autosave.ticks"), + this.getConfigYml().getInt("autosave.ticks") + ); this.getScheduler().runTimer(new LeaderboardHandler.Runnable(), 50, 2400); } diff --git a/eco-core/core-plugin/src/main/resources/config.yml b/eco-core/core-plugin/src/main/resources/config.yml index 99778b3..3e1fff7 100644 --- a/eco-core/core-plugin/src/main/resources/config.yml +++ b/eco-core/core-plugin/src/main/resources/config.yml @@ -324,5 +324,6 @@ commands: use-display-name: true autosave: + ticks: 20000 # The amount of ticks between autosaves log: true # If auto-save messages should be sent to console async: false # If saves should be performed asynchronously. May cause bugs without MySQL \ No newline at end of file