From 08e387238c9e37c61eb257506b28a01fcbeab4cd Mon Sep 17 00:00:00 2001 From: Auxilor Date: Fri, 27 Nov 2020 13:00:03 +0000 Subject: [PATCH] Finished refactoring update checker --- .../com/willfp/ecoenchants/listeners/PlayerJoinListener.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Plugin/src/main/java/com/willfp/ecoenchants/listeners/PlayerJoinListener.java b/Plugin/src/main/java/com/willfp/ecoenchants/listeners/PlayerJoinListener.java index 5f4c5ea6..14ba09fd 100644 --- a/Plugin/src/main/java/com/willfp/ecoenchants/listeners/PlayerJoinListener.java +++ b/Plugin/src/main/java/com/willfp/ecoenchants/listeners/PlayerJoinListener.java @@ -2,6 +2,7 @@ package com.willfp.ecoenchants.listeners; import com.willfp.ecoenchants.EcoEnchantsPlugin; import com.willfp.ecoenchants.config.ConfigManager; +import com.willfp.ecoenchants.util.UpdateChecker; import org.bukkit.event.EventHandler; import org.bukkit.event.Listener; import org.bukkit.event.player.PlayerJoinEvent; @@ -9,10 +10,10 @@ import org.bukkit.event.player.PlayerJoinEvent; public class PlayerJoinListener implements Listener { @EventHandler public void onPlayerJoin(PlayerJoinEvent event) { - if (EcoEnchantsPlugin.outdated) { + if (UpdateChecker.isOutdated()) { if (event.getPlayer().hasPermission("ecoenchants.updateannounce")) { event.getPlayer().sendMessage(ConfigManager.getLang().getMessage("outdated").replace("%ver%", EcoEnchantsPlugin.getInstance().getDescription().getVersion()) - .replace("%newver%", EcoEnchantsPlugin.newVersion)); + .replace("%newver%", UpdateChecker.getNewVersion())); } } }