diff options
author | snowleo <schneeleo@gmail.com> | 2011-10-27 01:18:59 +0200 |
---|---|---|
committer | snowleo <schneeleo@gmail.com> | 2011-10-27 01:18:59 +0200 |
commit | e0a29ed6a02373fb93563de3f808b009f3fb2a12 (patch) | |
tree | 348e30c1e2541736ea48cbf7af986f41aae41485 | |
parent | fd7894caae697a669e9e185af74339ae3f9ee1c2 (diff) | |
download | Essentials-e0a29ed6a02373fb93563de3f808b009f3fb2a12.tar Essentials-e0a29ed6a02373fb93563de3f808b009f3fb2a12.tar.gz Essentials-e0a29ed6a02373fb93563de3f808b009f3fb2a12.tar.lz Essentials-e0a29ed6a02373fb93563de3f808b009f3fb2a12.tar.xz Essentials-e0a29ed6a02373fb93563de3f808b009f3fb2a12.zip |
Don't block /essentialsupdate command after selfupdate
-rw-r--r-- | EssentialsUpdate/src/com/earth2me/essentials/update/UpdateProcess.java | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/EssentialsUpdate/src/com/earth2me/essentials/update/UpdateProcess.java b/EssentialsUpdate/src/com/earth2me/essentials/update/UpdateProcess.java index 70607923b..1b26f1d32 100644 --- a/EssentialsUpdate/src/com/earth2me/essentials/update/UpdateProcess.java +++ b/EssentialsUpdate/src/com/earth2me/essentials/update/UpdateProcess.java @@ -65,13 +65,33 @@ public class UpdateProcess extends PlayerListener @Override public void onWorkAbort(final String message) { - Bukkit.getLogger().log(Level.SEVERE, message); + if (message != null && !message.isEmpty() + && UpdateProcess.this.currentPlayer != null + && UpdateProcess.this.currentPlayer.isOnline()) + { + UpdateProcess.this.currentPlayer.sendMessage(message); + } + if (message != null && !message.isEmpty()) + { + Bukkit.getLogger().log(Level.SEVERE, message); + } + UpdateProcess.this.currentPlayer = null; } @Override public void onWorkDone(final String message) { - Bukkit.getLogger().log(Level.INFO, message); + if (message != null && !message.isEmpty() + && UpdateProcess.this.currentPlayer != null + && UpdateProcess.this.currentPlayer.isOnline()) + { + UpdateProcess.this.currentPlayer.sendMessage(message); + } + if (message != null && !message.isEmpty()) + { + Bukkit.getLogger().log(Level.INFO, message); + } + UpdateProcess.this.currentPlayer = null; } }).start(); return true; @@ -84,6 +104,7 @@ public class UpdateProcess extends PlayerListener currentPlayer.sendMessage(message); } Bukkit.getLogger().log(Level.INFO, message); + currentPlayer = null; return true; } return false; |