From 80a0ca2b1561ad11c362bed8d81a171e6662ab8e Mon Sep 17 00:00:00 2001 From: LoJoSho Date: Fri, 17 Jan 2025 13:36:04 -0600 Subject: [PATCH] clean: resource update checker create version variable --- .../main/java/me/lojosho/hibiscuscommons/HibiscusPlugin.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/common/src/main/java/me/lojosho/hibiscuscommons/HibiscusPlugin.java b/common/src/main/java/me/lojosho/hibiscuscommons/HibiscusPlugin.java index 6992540..f56c3cc 100644 --- a/common/src/main/java/me/lojosho/hibiscuscommons/HibiscusPlugin.java +++ b/common/src/main/java/me/lojosho/hibiscuscommons/HibiscusPlugin.java @@ -63,12 +63,13 @@ public abstract class HibiscusPlugin extends JavaPlugin { .onSuccess((commandSenders, latestVersion) -> { this.latestVersion = (String) latestVersion; String pluginName = getDescription().getName(); + String version = getDescription().getVersion(); - if (!this.latestVersion.equalsIgnoreCase(getDescription().getVersion())) { + if (!this.latestVersion.equalsIgnoreCase(version)) { getLogger().info("+++++++++++++++++++++++++++++++++++"); getLogger().info("There is a new update for " + pluginName + "!"); getLogger().info("Please download it as soon as possible for possible fixes and new features."); - getLogger().info("Current Version " + getDescription().getVersion() + " | Latest Version " + latestVersion); + getLogger().info("Current Version " + version + " | Latest Version " + latestVersion); //getLogger().info("Spigot: https://www.spigotmc.org/resources/100107/"); getLogger().info("Polymart: https://polymart.org/resource/" + resourceID); getLogger().info("+++++++++++++++++++++++++++++++++++");