Added auto save feature.

This commit is contained in:
Brianna O'Keefe 2019-01-01 23:41:16 -05:00
parent 60659cd7a2
commit c9e2ca80aa
2 changed files with 3 additions and 1 deletions

View File

@ -214,7 +214,8 @@ public class EpicHoppersPlugin extends JavaPlugin implements EpicHoppers {
new HopHandler(this);
teleportHandler = new TeleportHandler(this);
Bukkit.getScheduler().scheduleSyncRepeatingTask(this, this::saveToFile, 6000, 6000);
int timeout = getConfig().getInt("Main.Auto Save Interval In Seconds")* 60 * 20;
Bukkit.getScheduler().runTaskTimerAsynchronously(this, this::saveToFile, timeout, timeout);
PluginManager pluginManager = Bukkit.getPluginManager();

View File

@ -182,6 +182,7 @@ public class SettingsManager implements Listener {
ENDERCHESTS("Main.Support Enderchests", true),
PARTICLE_TYPE("Main.Upgrade Particle Type", "SPELL_WITCH"),
HOP_TICKS("Main.Amount of Ticks Between Hops", 8L),
AUTOSAVE("Main.Auto Save Interval In Seconds", 15),
TELEPORT_TICKS("Main.Amount of Ticks Between Teleport", 10L),
SYNC_TIMEOUT("Main.Timeout When Syncing Hoppers", 300L),
MAX_CHUNK("Main.Max Hoppers Per Chunk", -1),