From 91de7e5a22c59ba15a2dd60c92499a3c8fd5d4a6 Mon Sep 17 00:00:00 2001 From: HugoDaBosss Date: Sun, 6 Mar 2016 15:11:36 +0100 Subject: [PATCH] Fix checkforupdates changing from false to true FIXED: When starting the server when checkforupdates is false, it won't register the listener. So when you enable checkforupdates using /viaversion dontbugme it won't send you messages until a restart. --- src/main/java/us/myles/ViaVersion/ViaVersionPlugin.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/main/java/us/myles/ViaVersion/ViaVersionPlugin.java b/src/main/java/us/myles/ViaVersion/ViaVersionPlugin.java index ccd2d7fb0..4b89884d1 100644 --- a/src/main/java/us/myles/ViaVersion/ViaVersionPlugin.java +++ b/src/main/java/us/myles/ViaVersion/ViaVersionPlugin.java @@ -55,10 +55,8 @@ public class ViaVersionPlugin extends JavaPlugin implements ViaVersionAPI { getLogger().severe("Unable to inject handlers, are you on 1.8? "); e.printStackTrace(); } - if (getConfig().getBoolean("checkforupdates")) { - Bukkit.getPluginManager().registerEvents(new UpdateListener(this), this); + if (getConfig().getBoolean("checkforupdates")) UpdateUtil.sendUpdateMessage(this); - } Bukkit.getPluginManager().registerEvents(new Listener() { @EventHandler @@ -69,6 +67,7 @@ public class ViaVersionPlugin extends JavaPlugin implements ViaVersionAPI { Bukkit.getPluginManager().registerEvents(new ArmorListener(this), this); Bukkit.getPluginManager().registerEvents(new CommandBlockListener(this), this); + Bukkit.getPluginManager().registerEvents(new UpdateListener(this), this); getCommand("viaversion").setExecutor(new ViaVersionCommand(this)); }