From 535946d95dbed3f60e54188bcce72a032c826c2d Mon Sep 17 00:00:00 2001 From: libraryaddict Date: Fri, 24 Apr 2020 17:08:40 +1200 Subject: [PATCH] Fixes error and more info for auto update --- .../disguise/commands/libsdisguises/LDUpdate.java | 2 +- .../disguise/utilities/listeners/DisguiseListener.java | 8 ++++++-- 2 files changed, 7 insertions(+), 3 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 89bb6a53..071c558c 100644 --- a/src/main/java/me/libraryaddict/disguise/commands/libsdisguises/LDUpdate.java +++ b/src/main/java/me/libraryaddict/disguise/commands/libsdisguises/LDUpdate.java @@ -72,7 +72,7 @@ public class LDUpdate implements LDCommand { if (sender instanceof Player) { Bukkit.getConsoleSender().sendMessage(LibsMsg.UPDATE_SUCCESS.get()); - sender.sendMessage(LibsMsg.UPDATE_INFO + Bukkit.getConsoleSender().sendMessage(LibsMsg.UPDATE_INFO .get(result.getVersion(), result.getBuildNumber(), result.getParsedBuildDate().toString(), result.getSize() / 1024)); } diff --git a/src/main/java/me/libraryaddict/disguise/utilities/listeners/DisguiseListener.java b/src/main/java/me/libraryaddict/disguise/utilities/listeners/DisguiseListener.java index f488a662..d201480b 100644 --- a/src/main/java/me/libraryaddict/disguise/utilities/listeners/DisguiseListener.java +++ b/src/main/java/me/libraryaddict/disguise/utilities/listeners/DisguiseListener.java @@ -17,6 +17,7 @@ import me.libraryaddict.disguise.utilities.LibsPremium; import me.libraryaddict.disguise.utilities.UpdateChecker; import me.libraryaddict.disguise.utilities.modded.ModdedEntity; import me.libraryaddict.disguise.utilities.modded.ModdedManager; +import me.libraryaddict.disguise.utilities.plugin.PluginInformation; import me.libraryaddict.disguise.utilities.translations.LibsMsg; import org.apache.commons.lang.math.RandomUtils; import org.bukkit.Bukkit; @@ -145,8 +146,11 @@ public class DisguiseListener implements Listener { latestVersion = "" + updateChecker.getLatestSnapshot(); if (autoUpdate && plugin.isNumberedBuild()) { - boolean result = updateChecker.grabSnapshotBuild(); - updateMessage = result ? LibsMsg.UPDATE_SUCCESS : LibsMsg.UPDATE_FAILED; + PluginInformation result = updateChecker.grabSnapshotBuild(); + updateMessage = result != null ? LibsMsg.UPDATE_SUCCESS : LibsMsg.UPDATE_FAILED; + Bukkit.getConsoleSender().sendMessage(LibsMsg.UPDATE_INFO + .get(result.getVersion(), result.getBuildNumber(), + result.getParsedBuildDate().toString(), result.getSize() / 1024)); } else { currentVersion = plugin.getBuildNo(); updateMessage = LibsMsg.UPDATE_READY_SNAPSHOT;