From a66b41e4f52c21a446767e076328dfd2d4d5a958 Mon Sep 17 00:00:00 2001 From: libraryaddict Date: Sat, 19 Sep 2020 07:24:12 +1200 Subject: [PATCH] Always update if you can --- .../commands/libsdisguises/LDUpdate.java | 35 +++---------------- 1 file changed, 4 insertions(+), 31 deletions(-) diff --git a/src/main/java/me/libraryaddict/disguise/commands/libsdisguises/LDUpdate.java b/src/main/java/me/libraryaddict/disguise/commands/libsdisguises/LDUpdate.java index 393ac4e0..fde853be 100644 --- a/src/main/java/me/libraryaddict/disguise/commands/libsdisguises/LDUpdate.java +++ b/src/main/java/me/libraryaddict/disguise/commands/libsdisguises/LDUpdate.java @@ -40,8 +40,6 @@ public class LDUpdate implements LDCommand { } boolean releaseBuilds = checker.isUsingReleaseBuilds(); - boolean wantsCheck = args[0].endsWith("?"); - boolean wantsDownload = args[0].endsWith("!") || !wantsCheck; if (args.length > 1) { boolean previous = releaseBuilds; @@ -55,45 +53,20 @@ public class LDUpdate implements LDCommand { return; } - if (previous != releaseBuilds && !wantsCheck) { - wantsDownload = true; - } - - wantsCheck = true; - DisguiseConfig.setUsingReleaseBuilds(releaseBuilds); } - if (checker.getUpdate() != null && checker.getUpdate().isReleaseBuild() == releaseBuilds && !wantsCheck) { - if (checker.isServerLatestVersion()) { - LibsMsg.UPDATE_ON_LATEST.send(sender); - return; - } - - if (checker.isOnLatestUpdate(true)) { - LibsMsg.UPDATE_ALREADY_DOWNLOADED.send(sender); - return; - } - } - - boolean finalWantsCheck = wantsCheck; - boolean finalWantsDownload = wantsDownload; - new BukkitRunnable() { @Override public void run() { - LibsMsg updateResult = null; - - if (checker.getUpdate() == null || args.length > 1 || checker.isOldUpdate() || finalWantsCheck) { - updateResult = checker.doUpdateCheck(); - } + LibsMsg updateResult = checker.doUpdateCheck(); if (checker.getUpdate() == null) { LibsMsg.UPDATE_FAILED.send(sender); return; } - if (checker.isOnLatestUpdate(true) && !finalWantsDownload) { + if (checker.isOnLatestUpdate(true)) { if (checker.getLastDownload() != null) { LibsMsg.UPDATE_ALREADY_DOWNLOADED.send(sender); } else { @@ -103,7 +76,7 @@ public class LDUpdate implements LDCommand { return; } - if (!finalWantsDownload) { + /*if (!finalWantsDownload) { if (updateResult != null) { updateResult.send(sender); } else { @@ -113,7 +86,7 @@ public class LDUpdate implements LDCommand { } return; - } + }*/ PluginInformation result = checker.doUpdate();