Always send info about version

This commit is contained in:
Minecon724 2025-01-05 11:32:35 +01:00
parent 15c99d007a
commit b26b8a1ded
Signed by: Minecon724
GPG key ID: 3CCC4D267742C8E8

View file

@ -52,13 +52,6 @@ public class UpdateCommand {
if (args.length == 1) { // remember this function is proxied if (args.length == 1) { // remember this function is proxied
updater.getLatestVersion().thenAccept(metadata -> { updater.getLatestVersion().thenAccept(metadata -> {
if (metadata != null) {
sender.sendMessage("An update is available!");
sender.sendMessage("Giants " + metadata.getLabel() + " released " + formatDate(metadata.getTimestamp()));
sendChangelogMessage(sender, metadata.getChangelogUrl());
sender.sendMessage("To download: /giants update download");
} else {
sender.sendMessage("No new updates");
updater.getCurrentVersion().thenAccept(metadata2 -> { updater.getCurrentVersion().thenAccept(metadata2 -> {
sender.sendMessage("You're on Giants " + metadata2.getLabel() + " released " + formatDate(metadata2.getTimestamp())); sender.sendMessage("You're on Giants " + metadata2.getLabel() + " released " + formatDate(metadata2.getTimestamp()));
sendChangelogMessage(sender, metadata2.getChangelogUrl()); sendChangelogMessage(sender, metadata2.getChangelogUrl());
@ -67,6 +60,14 @@ public class UpdateCommand {
e.printStackTrace(); e.printStackTrace();
return null; return null;
}); });
if (metadata != null) {
sender.sendMessage("An update is available!");
sender.sendMessage("Giants " + metadata.getLabel() + " released " + formatDate(metadata.getTimestamp()));
sendChangelogMessage(sender, metadata.getChangelogUrl());
sender.sendMessage("To download: /giants update download");
} else {
sender.sendMessage("No new updates");
} }
}).exceptionally(e -> { }).exceptionally(e -> {
sender.sendMessage("Error checking for update. See console for details."); sender.sendMessage("Error checking for update. See console for details.");