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 | 76f8cb96cabcf524b4babbaed24fd7dd557375cb (patch) | |
tree | 1ddd663a9a4f0e3cdf85a403fa85ef4e4791a5de /EssentialsUpdate/src/com/earth2me | |
parent | f6e56ce0f4e01d5533883e7afcec159cbbbde771 (diff) | |
download | Essentials-76f8cb96cabcf524b4babbaed24fd7dd557375cb.tar Essentials-76f8cb96cabcf524b4babbaed24fd7dd557375cb.tar.gz Essentials-76f8cb96cabcf524b4babbaed24fd7dd557375cb.tar.lz Essentials-76f8cb96cabcf524b4babbaed24fd7dd557375cb.tar.xz Essentials-76f8cb96cabcf524b4babbaed24fd7dd557375cb.zip |
Reload after installation
Diffstat (limited to 'EssentialsUpdate/src/com/earth2me')
-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) { |