You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
if (this.remoteVersion !=null&& remoteVersion?.isHigherThan(this.localVersion) ==true) {
39
+
logger.warn(MiniMessage.miniMessage().deserialize("<yellow>Your version (${localVersion}) is older than our latest published version (${remoteVersion.toString()}). Please update as soon as possible to get continued support. Or use this link ${DOWNLOAD_URL.format(remoteVersion.toString())}"))
40
+
}
41
+
}
42
+
43
+
funnotifyPlayer(player:Player) {
44
+
if (this.remoteVersion !=null&& remoteVersion?.isHigherThan(this.localVersion) ==true) {
player.sendMessage(MiniMessage.miniMessage().deserialize("<yellow><click:open_url:'https://hangar.papermc.io/OneLiteFeather/Attollo'>Your version (${localVersion}) is older than our latest published version (${remoteVersion.toString()}). Please update as soon as possible to get continued support. Or click me to get on the download page!</click>"))
51
+
}
52
+
53
+
privatefungetNewerVersion(): Version? {
54
+
try {
55
+
val httpResponse = hangarClient.send(
56
+
LATEST_RELEASE_VERSION_REQUEST,
57
+
HttpResponse.BodyHandlers.ofString()
58
+
)
59
+
val remoteVersion =Version.parse(httpResponse.body())
60
+
if (remoteVersion.isHigherThan(this.localVersion)) {
61
+
return remoteVersion
62
+
}
63
+
} catch (e:IOException) {
64
+
LOGGER.error("Something went wrong to check updates", e)
65
+
} catch (e:InterruptedException) {
66
+
LOGGER.error("Something went wrong to check updates", e)
0 commit comments