From 307928e5571184ec6c39a4902539efdfc65d63d4 Mon Sep 17 00:00:00 2001 From: RayzsYT <51991564+RayzsYT@users.noreply.github.com> Date: Mon, 13 May 2024 22:30:14 +0200 Subject: [PATCH] Fix New PlaceHolder --- src/main/java/de/rayzs/pat/plugin/BukkitLoader.java | 4 +++- src/main/java/de/rayzs/pat/utils/Storage.java | 2 +- src/main/resources/files/bukkit-config.yml | 2 +- src/main/resources/files/bungee-config.yml | 2 +- src/main/resources/files/velocity-config.yml | 2 +- 5 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/main/java/de/rayzs/pat/plugin/BukkitLoader.java b/src/main/java/de/rayzs/pat/plugin/BukkitLoader.java index 3d2ad828..6068a28e 100644 --- a/src/main/java/de/rayzs/pat/plugin/BukkitLoader.java +++ b/src/main/java/de/rayzs/pat/plugin/BukkitLoader.java @@ -91,7 +91,9 @@ public class BukkitLoader extends JavaPlugin { updaterTaskId = Bukkit.getScheduler().scheduleAsyncRepeatingTask(this, () -> { String result = new ConnectionBuilder().setUrl("https://www.rayzs.de/proantitab/api/version.php") .setProperties("ProAntiTab", "4654").connect().getResponse(); - if (!result.equals(getDescription().getVersion())) { + Storage.NEWEST_VERSION_NAME = result; + + if (!Storage.NEWEST_VERSION_NAME.equals(Storage.CURRENT_VERSION_NAME)) { Bukkit.getScheduler().cancelTask(updaterTaskId); if (result.equals("unknown")) { Logger.warning("Failed reaching web host! (firewall enabled? website down?)"); diff --git a/src/main/java/de/rayzs/pat/utils/Storage.java b/src/main/java/de/rayzs/pat/utils/Storage.java index 47cfc8af..a3e2a9e2 100644 --- a/src/main/java/de/rayzs/pat/utils/Storage.java +++ b/src/main/java/de/rayzs/pat/utils/Storage.java @@ -39,7 +39,7 @@ public class Storage { defaultUnknownCommandArray.add("&cThis command does not exist!"); - defaultNotificationArray.add("&8[&4ProAntiTab&8] &cYou're using an outdated version of this plugin!"); + defaultNotificationArray.add("&8[&4ProAntiTab&8] &cYou're using an outdated version of this plugin! (%current_version% -> %newest_version%)"); defaultNotificationArray.add("&8[&4ProAntiTab&8] &cPlease update it on: &ehttps://www.rayzs.de/products/proantitab/page"); UPDATE_ENABLED = (boolean) CONFIGURATION.getOrSet("updater.enabled", true); diff --git a/src/main/resources/files/bukkit-config.yml b/src/main/resources/files/bukkit-config.yml index d30a4d76..45ec0801 100644 --- a/src/main/resources/files/bukkit-config.yml +++ b/src/main/resources/files/bukkit-config.yml @@ -2,7 +2,7 @@ updater: enabled: true period: 18000 notification: - - '&8[&4ProAntiTab&8] &cYou are using an outdated version of this plugin! (%current_version% -> %newest-version%)' + - '&8[&4ProAntiTab&8] &cYou are using an outdated version of this plugin! (%current_version% -> %newest_version%)' - '&8[&4ProAntiTab&8] &cPlease update it on: &ehttps://www.rayzs.de/products/proantitab/page' handle-through-bungeecord: diff --git a/src/main/resources/files/bungee-config.yml b/src/main/resources/files/bungee-config.yml index cf839efb..42a20bf4 100644 --- a/src/main/resources/files/bungee-config.yml +++ b/src/main/resources/files/bungee-config.yml @@ -2,7 +2,7 @@ updater: enabled: true period: 18000 notification: - - '&8[&4ProAntiTab&8] &cYou are using an outdated version of this plugin! (%current_version% -> %newest-version%)' + - '&8[&4ProAntiTab&8] &cYou are using an outdated version of this plugin! (%current_version% -> %newest_version%)' - '&8[&4ProAntiTab&8] &cPlease update it on: &ehttps://www.rayzs.de/products/proantitab/page' turn-blacklist-to-whitelist: false diff --git a/src/main/resources/files/velocity-config.yml b/src/main/resources/files/velocity-config.yml index cf839efb..42a20bf4 100644 --- a/src/main/resources/files/velocity-config.yml +++ b/src/main/resources/files/velocity-config.yml @@ -2,7 +2,7 @@ updater: enabled: true period: 18000 notification: - - '&8[&4ProAntiTab&8] &cYou are using an outdated version of this plugin! (%current_version% -> %newest-version%)' + - '&8[&4ProAntiTab&8] &cYou are using an outdated version of this plugin! (%current_version% -> %newest_version%)' - '&8[&4ProAntiTab&8] &cPlease update it on: &ehttps://www.rayzs.de/products/proantitab/page' turn-blacklist-to-whitelist: false