From b26b8a1ded2cf513f6d23fd2fca113699ff0a2ed Mon Sep 17 00:00:00 2001 From: Minecon724 Date: Sun, 5 Jan 2025 11:32:35 +0100 Subject: [PATCH] Always send info about version --- .../eu/m724/giants/updater/UpdateCommand.java | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/src/main/java/eu/m724/giants/updater/UpdateCommand.java b/src/main/java/eu/m724/giants/updater/UpdateCommand.java index f0ff445..a7aa963 100644 --- a/src/main/java/eu/m724/giants/updater/UpdateCommand.java +++ b/src/main/java/eu/m724/giants/updater/UpdateCommand.java @@ -52,6 +52,15 @@ public class UpdateCommand { if (args.length == 1) { // remember this function is proxied updater.getLatestVersion().thenAccept(metadata -> { + updater.getCurrentVersion().thenAccept(metadata2 -> { + sender.sendMessage("You're on Giants " + metadata2.getLabel() + " released " + formatDate(metadata2.getTimestamp())); + sendChangelogMessage(sender, metadata2.getChangelogUrl()); + }).exceptionally(e -> { + sender.sendMessage("Error retrieving information about current version, see console for details. " + e.getMessage()); + e.printStackTrace(); + return null; + }); + if (metadata != null) { sender.sendMessage("An update is available!"); sender.sendMessage("Giants " + metadata.getLabel() + " released " + formatDate(metadata.getTimestamp())); @@ -59,14 +68,6 @@ public class UpdateCommand { sender.sendMessage("To download: /giants update download"); } else { sender.sendMessage("No new updates"); - updater.getCurrentVersion().thenAccept(metadata2 -> { - sender.sendMessage("You're on Giants " + metadata2.getLabel() + " released " + formatDate(metadata2.getTimestamp())); - sendChangelogMessage(sender, metadata2.getChangelogUrl()); - }).exceptionally(e -> { - sender.sendMessage("Error retrieving information about current version, see console for details. " + e.getMessage()); - e.printStackTrace(); - return null; - }); } }).exceptionally(e -> { sender.sendMessage("Error checking for update. See console for details.");