diff options
author | snowleo <schneeleo@gmail.com> | 2011-10-26 22:23:30 +0200 |
---|---|---|
committer | snowleo <schneeleo@gmail.com> | 2011-10-26 22:23:30 +0200 |
commit | 7ef9b2363366422db19f9d0cb07ca9b131a95b60 (patch) | |
tree | 4c9b7ff7f3d8c82a2ec14c9aba92b08125068be5 | |
parent | 0be5233b89c624412f08222d4f572ff4087a1ae9 (diff) | |
download | Essentials-7ef9b2363366422db19f9d0cb07ca9b131a95b60.tar Essentials-7ef9b2363366422db19f9d0cb07ca9b131a95b60.tar.gz Essentials-7ef9b2363366422db19f9d0cb07ca9b131a95b60.tar.lz Essentials-7ef9b2363366422db19f9d0cb07ca9b131a95b60.tar.xz Essentials-7ef9b2363366422db19f9d0cb07ca9b131a95b60.zip |
Reload after installation
-rw-r--r-- | EssentialsUpdate/src/com/earth2me/essentials/update/states/StateMachine.java | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/EssentialsUpdate/src/com/earth2me/essentials/update/states/StateMachine.java b/EssentialsUpdate/src/com/earth2me/essentials/update/states/StateMachine.java index 9ced4fc66..4d8c8e45b 100644 --- a/EssentialsUpdate/src/com/earth2me/essentials/update/states/StateMachine.java +++ b/EssentialsUpdate/src/com/earth2me/essentials/update/states/StateMachine.java @@ -24,7 +24,7 @@ public class StateMachine extends WorkListener implements Runnable super(plugin, updateCheck.getNewVersionInfo()); this.player = player; states.clear(); - UpdateOrInstallation state = new UpdateOrInstallation(states, updateCheck); + final UpdateOrInstallation state = new UpdateOrInstallation(states, updateCheck); current = states.put(UpdateOrInstallation.class, state); } @@ -102,9 +102,10 @@ public class StateMachine extends WorkListener implements Runnable { if (StateMachine.this.player.isOnline()) { - StateMachine.this.player.sendMessage("Installation done."); + StateMachine.this.player.sendMessage("Installation done. Reloading server."); } finish(); + Bukkit.getServer().reload(); } }); return; @@ -155,19 +156,16 @@ public class StateMachine extends WorkListener implements Runnable getPlugin().getServer().getPluginManager().callEvent(new InstallationFinishedEvent()); } - public void resumeInstallation(Player player) + public void resumeInstallation(final Player player) { this.player = player; if (result == MachineResult.WAIT) { - if (current != null) - { - current.askQuestion(player); - } - else + if (current == null) { throw new RuntimeException("State is WAIT, but current state is null!"); } + current.askQuestion(player); } if (result == MachineResult.DONE && iterator != null) { @@ -175,7 +173,7 @@ public class StateMachine extends WorkListener implements Runnable } if (result == MachineResult.ABORT) { - throw new RuntimeException("Player should not be able to resume a aborted installation."); + throw new RuntimeException("Player should not be able to resume an aborted installation."); } if (result == MachineResult.NONE) { |