Fixes error and more info for auto update

This commit is contained in:
libraryaddict 2020-04-24 17:08:40 +12:00
parent e7b2fa374b
commit 535946d95d
No known key found for this signature in database
GPG Key ID: 052E4FBCD257AEA4
2 changed files with 7 additions and 3 deletions

View File

@ -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));
}

View File

@ -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;