From d5cb9ab96556e9f438db688dd8f097f53089028a Mon Sep 17 00:00:00 2001 From: snowleo Date: Wed, 26 Oct 2011 20:24:46 +0200 Subject: Cleanup --- .../com/earth2me/essentials/update/UpdateProcess.java | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/EssentialsUpdate/src/com/earth2me/essentials/update/UpdateProcess.java b/EssentialsUpdate/src/com/earth2me/essentials/update/UpdateProcess.java index c582ebd53..393bf5aef 100644 --- a/EssentialsUpdate/src/com/earth2me/essentials/update/UpdateProcess.java +++ b/EssentialsUpdate/src/com/earth2me/essentials/update/UpdateProcess.java @@ -3,6 +3,7 @@ package com.earth2me.essentials.update; import com.earth2me.essentials.update.states.InstallationFinishedEvent; import com.earth2me.essentials.update.states.StateMachine; import java.util.List; +import java.util.logging.Level; import org.bukkit.Bukkit; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; @@ -26,6 +27,7 @@ public class UpdateProcess extends PlayerListener public UpdateProcess(final Plugin plugin, final UpdateCheck updateCheck) { + super(); this.plugin = plugin; this.updateCheck = updateCheck; } @@ -36,16 +38,16 @@ public class UpdateProcess extends PlayerListener pluginManager.registerEvent(Type.PLAYER_QUIT, this, Priority.Low, plugin); pluginManager.registerEvent(Type.PLAYER_CHAT, this, Priority.Lowest, plugin); pluginManager.registerEvent(Type.PLAYER_JOIN, this, Priority.Normal, plugin); - pluginManager.registerEvent(Type.CUSTOM_EVENT, new CustomEventListener(){ - + pluginManager.registerEvent(Type.CUSTOM_EVENT, new CustomEventListener() + { @Override public void onCustomEvent(final Event event) { - if(event instanceof InstallationFinishedEvent) { + if (event instanceof InstallationFinishedEvent) + { UpdateProcess.this.currentPlayer = null; } } - }, Priority.Normal, plugin); } @@ -73,7 +75,8 @@ public class UpdateProcess extends PlayerListener public void onPlayerJoin(final PlayerJoinEvent event) { final Player player = event.getPlayer(); - if (currentPlayer.getName().equals(player.getName())) { + if (currentPlayer.getName().equals(player.getName())) + { currentPlayer = player; player.sendMessage("You quit the game, while the installion wizard was running."); player.sendMessage("The installation wizard will now resume."); @@ -109,10 +112,10 @@ public class UpdateProcess extends PlayerListener final VersionInfo info = updateCheck.getNewVersionInfo(); final List changelog = info.getChangelog(); - Bukkit.getLogger().info("Essentials changelog " + updateCheck.getNewVersion().toString()); + Bukkit.getLogger().log(Level.INFO, "Essentials changelog {0}", updateCheck.getNewVersion().toString()); for (String line : changelog) { - Bukkit.getLogger().info(" - " + line); + Bukkit.getLogger().log(Level.INFO, " - {0}", line); } final UpdatesDownloader downloader = new UpdatesDownloader(plugin, info); downloader.start(); -- cgit v1.2.3