This commit is contained in:
Jesse Boyd 2018-05-02 09:07:01 +10:00
parent c71d872517
commit af43e19018
No known key found for this signature in database
GPG Key ID: 59F1DE6293AF6E1F
3 changed files with 11 additions and 10 deletions

View File

@ -269,12 +269,12 @@ public class Fawe {
TaskManager.IMP.repeat(timer, 1);
// if (Settings.IMP.UPDATE) {
// Delayed updating
updater = new Updater();
TaskManager.IMP.async(() -> update());
TaskManager.IMP.repeatAsync(() -> update(), 36000);
// }
if (!Settings.IMP.UPDATE.equalsIgnoreCase("false")) {
// Delayed updating
updater = new Updater();
TaskManager.IMP.async(() -> update());
TaskManager.IMP.repeatAsync(() -> update(), 36000);
}
}
private boolean update() {

View File

@ -26,8 +26,9 @@ public class Settings extends Config {
@Comment({"Options: de, ru, tr",
"Create a PR to contribute a translation: https://github.com/boy0001/FastAsyncWorldedit/new/master/core/src/main/resources",})
public String LANGUAGE = "";
@Comment("Enable or disable automatic updates")
public boolean UPDATE = false;
@Comment({"Enable or disable automatic updates",
" - true = update automatically in the background"})
public String UPDATE = "confirm";
@Comment("Send anonymous usage statistics")
public boolean METRICS = true;
@Comment({

View File

@ -102,11 +102,11 @@ public class Updater {
}
outFile.renameTo(finalFile);
if (Settings.IMP.UPDATE) {
if (Settings.IMP.UPDATE.equalsIgnoreCase("true")) {
installUpdate(null);
Fawe.debug("Updated FAWE to " + versionString + " @ " + pendingFile);
MainUtil.sendAdmin("&a/restart&7 to update FAWE with these changes: &c/fawe changelog &7or&c " + "https://empcraft.com/fawe/cl?" + Integer.toHexString(currentVersion.hash));
} else {
} else if (!Settings.IMP.UPDATE.equalsIgnoreCase("false")) {
pendingFile = finalFile;
destFile = new File(jarFile.getParent(), "update" + File.separator + jarFile.getName());
pending = true;