mirror of
https://github.com/Auxilor/EcoEnchants.git
synced 2024-11-22 15:05:18 +01:00
Finished refactoring update checker
This commit is contained in:
parent
e848de746f
commit
08e387238c
@ -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()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user