summaryrefslogtreecommitdiffstats
path: root/EssentialsUpdate/src
diff options
context:
space:
mode:
authorKHobbits <rob@khobbits.co.uk>2012-12-31 02:28:52 +0000
committerKHobbits <rob@khobbits.co.uk>2012-12-31 02:28:52 +0000
commit86619275992b4b29bfac91897986b10f2ef863cb (patch)
treec46ac4dd7fb3a7d7dde90d508e3b123efd09def7 /EssentialsUpdate/src
parenta6b83ca260386fbafb24473aca5f95dc2d5c284b (diff)
downloadEssentials-86619275992b4b29bfac91897986b10f2ef863cb.tar
Essentials-86619275992b4b29bfac91897986b10f2ef863cb.tar.gz
Essentials-86619275992b4b29bfac91897986b10f2ef863cb.tar.lz
Essentials-86619275992b4b29bfac91897986b10f2ef863cb.tar.xz
Essentials-86619275992b4b29bfac91897986b10f2ef863cb.zip
Merge gravy's pull and reformat code
Diffstat (limited to 'EssentialsUpdate/src')
-rw-r--r--EssentialsUpdate/src/net/ess3/update/AbstractWorkListener.java1
-rw-r--r--EssentialsUpdate/src/net/ess3/update/EssentialsHelp.java5
-rw-r--r--EssentialsUpdate/src/net/ess3/update/UpdateCheck.java6
-rw-r--r--EssentialsUpdate/src/net/ess3/update/UpdateFile.java13
-rw-r--r--EssentialsUpdate/src/net/ess3/update/UpdateProcess.java80
-rw-r--r--EssentialsUpdate/src/net/ess3/update/Version.java1
-rw-r--r--EssentialsUpdate/src/net/ess3/update/chat/AbstractFileCommand.java4
-rw-r--r--EssentialsUpdate/src/net/ess3/update/chat/IrcBot.java25
-rw-r--r--EssentialsUpdate/src/net/ess3/update/states/AbstractState.java10
-rw-r--r--EssentialsUpdate/src/net/ess3/update/states/AbstractYesNoState.java10
-rw-r--r--EssentialsUpdate/src/net/ess3/update/states/Changelog.java4
-rw-r--r--EssentialsUpdate/src/net/ess3/update/states/EssentialsChat.java4
-rw-r--r--EssentialsUpdate/src/net/ess3/update/states/EssentialsGeoIP.java5
-rw-r--r--EssentialsUpdate/src/net/ess3/update/states/EssentialsProtect.java5
-rw-r--r--EssentialsUpdate/src/net/ess3/update/states/StateMachine.java18
-rw-r--r--EssentialsUpdate/src/net/ess3/update/states/UpdateOrInstallation.java3
-rw-r--r--EssentialsUpdate/src/net/ess3/update/tasks/InstallModule.java12
-rw-r--r--EssentialsUpdate/src/net/ess3/update/tasks/SelfUpdate.java9
18 files changed, 101 insertions, 114 deletions
diff --git a/EssentialsUpdate/src/net/ess3/update/AbstractWorkListener.java b/EssentialsUpdate/src/net/ess3/update/AbstractWorkListener.java
index 7a927d4db..e63508464 100644
--- a/EssentialsUpdate/src/net/ess3/update/AbstractWorkListener.java
+++ b/EssentialsUpdate/src/net/ess3/update/AbstractWorkListener.java
@@ -10,6 +10,7 @@ public abstract class AbstractWorkListener
this.plugin = plugin;
this.newVersionInfo = newVersionInfo;
}
+
private final transient Plugin plugin;
private final transient VersionInfo newVersionInfo;
diff --git a/EssentialsUpdate/src/net/ess3/update/EssentialsHelp.java b/EssentialsUpdate/src/net/ess3/update/EssentialsHelp.java
index a45b85117..b2da16187 100644
--- a/EssentialsUpdate/src/net/ess3/update/EssentialsHelp.java
+++ b/EssentialsUpdate/src/net/ess3/update/EssentialsHelp.java
@@ -1,6 +1,5 @@
package net.ess3.update;
-import net.ess3.update.chat.*;
import java.util.HashMap;
import java.util.Locale;
import java.util.Map;
@@ -13,6 +12,7 @@ import org.bukkit.event.player.PlayerChatEvent;
import org.bukkit.event.player.PlayerQuitEvent;
import org.bukkit.plugin.Plugin;
import org.bukkit.plugin.PluginManager;
+import net.ess3.update.chat.*;
public class EssentialsHelp implements Listener
@@ -50,7 +50,8 @@ public class EssentialsHelp implements Listener
chatUser = (Player)sender;
ircBot = null;
sender.sendMessage("You will be connected to the Essentials Help Chat.");
- sender.sendMessage("All your chat messages will be forwarded to the channel. You can't chat with other players on your server while in help chat, but you can use commands.");
+ sender.sendMessage(
+ "All your chat messages will be forwarded to the channel. You can't chat with other players on your server while in help chat, but you can use commands.");
sender.sendMessage("Please be patient, if noone is available, check back later.");
sender.sendMessage("Type !help to get a list of all commands.");
sender.sendMessage("Type !quit to leave the channel.");
diff --git a/EssentialsUpdate/src/net/ess3/update/UpdateCheck.java b/EssentialsUpdate/src/net/ess3/update/UpdateCheck.java
index 98a9983e8..51ebe9d1e 100644
--- a/EssentialsUpdate/src/net/ess3/update/UpdateCheck.java
+++ b/EssentialsUpdate/src/net/ess3/update/UpdateCheck.java
@@ -48,7 +48,8 @@ public class UpdateCheck
public void scheduleUpdateTask()
{
- plugin.getServer().getScheduler().scheduleAsyncRepeatingTask(plugin, new Runnable()
+ plugin.getServer().getScheduler().scheduleAsyncRepeatingTask(
+ plugin, new Runnable()
{
@Override
public void run()
@@ -187,7 +188,8 @@ public class UpdateCheck
private int getBukkitVersion()
{
- final Matcher versionMatch = Pattern.compile("git-Bukkit-(?:(?:[0-9]+)\\.)+[0-9]+-R[\\.0-9]+-(?:[0-9]+-g[0-9a-f]+-)?b([0-9]+)jnks.*").matcher(plugin.getServer().getVersion());
+ final Matcher versionMatch = Pattern.compile("git-Bukkit-(?:(?:[0-9]+)\\.)+[0-9]+-R[\\.0-9]+-(?:[0-9]+-g[0-9a-f]+-)?b([0-9]+)jnks.*").matcher(
+ plugin.getServer().getVersion());
if (versionMatch.matches())
{
return Integer.parseInt(versionMatch.group(1));
diff --git a/EssentialsUpdate/src/net/ess3/update/UpdateFile.java b/EssentialsUpdate/src/net/ess3/update/UpdateFile.java
index cdab65600..7a44a2ade 100644
--- a/EssentialsUpdate/src/net/ess3/update/UpdateFile.java
+++ b/EssentialsUpdate/src/net/ess3/update/UpdateFile.java
@@ -1,10 +1,6 @@
package net.ess3.update;
-import java.io.BufferedInputStream;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.IOException;
+import java.io.*;
import java.math.BigInteger;
import java.security.KeyFactory;
import java.security.PublicKey;
@@ -25,7 +21,9 @@ public class UpdateFile
{
private final static Logger LOGGER = Bukkit.getLogger();
private final static String UPDATE_URL = "http://goo.gl/67jev";
- private final static BigInteger PUBLIC_KEY = new BigInteger("5ha6a2d4qdy17ttkg8evh74sl5a87djojwenu12k1lvy8ui6003e6l06rntczpoh99mhc3txj8mqlxw111oyy9yl7s7qpyluyzix3j1odxrxx4u52gxvyu6qiteapczkzvi7rxgeqsozz7b19rdx73a7quo9ybwpz1cr82r7x5k0pg2a73pjjsv2j1awr13azo7klrcxp9y5xxwf5qv1s3tw4zqftli18u0ek5qkbzfbgk1v5n2f11pkwwk6p0mibrn26wnjbv11vyiqgu95o7busmt6vf5q7grpcenl637w83mbin56s3asj1131b2mscj9xep3cbj7la9tgsxl5bj87vzy8sk2d34kzwqdqgh9nry43nqqus12l1stmiv184r8r3jcy8w43e8h1u1mzklldb5eytkuhayqik8l3ns04hwt8sgacvw534be8sx26qrn5s1", 36);
+ private final static BigInteger PUBLIC_KEY = new BigInteger(
+ "5ha6a2d4qdy17ttkg8evh74sl5a87djojwenu12k1lvy8ui6003e6l06rntczpoh99mhc3txj8mqlxw111oyy9yl7s7qpyluyzix3j1odxrxx4u52gxvyu6qiteapczkzvi7rxgeqsozz7b19rdx73a7quo9ybwpz1cr82r7x5k0pg2a73pjjsv2j1awr13azo7klrcxp9y5xxwf5qv1s3tw4zqftli18u0ek5qkbzfbgk1v5n2f11pkwwk6p0mibrn26wnjbv11vyiqgu95o7busmt6vf5q7grpcenl637w83mbin56s3asj1131b2mscj9xep3cbj7la9tgsxl5bj87vzy8sk2d34kzwqdqgh9nry43nqqus12l1stmiv184r8r3jcy8w43e8h1u1mzklldb5eytkuhayqik8l3ns04hwt8sgacvw534be8sx26qrn5s1",
+ 36);
private final transient File file;
private final transient Plugin plugin;
private final transient TreeMap<Version, VersionInfo> versions = new TreeMap<Version, VersionInfo>();
@@ -105,8 +103,7 @@ public class UpdateFile
{
break;
}
- else if ((cur >= '0' && cur <= '9')
- || (cur >= 'a' && cur <= 'z'))
+ else if ((cur >= '0' && cur <= '9') || (cur >= 'a' && cur <= 'z'))
{
if (isSignature)
{
diff --git a/EssentialsUpdate/src/net/ess3/update/UpdateProcess.java b/EssentialsUpdate/src/net/ess3/update/UpdateProcess.java
index f96cdd18f..774dd4ac1 100644
--- a/EssentialsUpdate/src/net/ess3/update/UpdateProcess.java
+++ b/EssentialsUpdate/src/net/ess3/update/UpdateProcess.java
@@ -1,8 +1,5 @@
package net.ess3.update;
-import net.ess3.update.states.InstallationFinishedEvent;
-import net.ess3.update.states.StateMachine;
-import net.ess3.update.tasks.SelfUpdate;
import java.util.logging.Level;
import org.bukkit.Bukkit;
import org.bukkit.command.CommandSender;
@@ -13,6 +10,10 @@ import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerChatEvent;
import org.bukkit.event.player.PlayerJoinEvent;
import org.bukkit.plugin.Plugin;
+import net.ess3.update.states.InstallationFinishedEvent;
+import net.ess3.update.states.StateMachine;
+import net.ess3.update.tasks.SelfUpdate;
+
// TODO: This whole thing should make use of the conversations api
public class UpdateProcess implements Listener
@@ -43,40 +44,37 @@ public class UpdateProcess implements Listener
currentPlayer.sendMessage("A newer version of EssentialsUpdate is found. Downloading new file and reloading server.");
}
Bukkit.getLogger().log(Level.INFO, "A newer version of EssentialsUpdate is found. Downloading new file and reloading server.");
- new SelfUpdate(new AbstractWorkListener(plugin, updateCheck.getNewVersionInfo())
- {
- @Override
- public void onWorkAbort(final String message)
- {
- if (message != null && !message.isEmpty()
- && UpdateProcess.this.currentPlayer != null
- && UpdateProcess.this.currentPlayer.isOnline())
- {
- UpdateProcess.this.currentPlayer.sendMessage(message);
- }
- if (message != null && !message.isEmpty())
+ new SelfUpdate(
+ new AbstractWorkListener(plugin, updateCheck.getNewVersionInfo())
{
- Bukkit.getLogger().log(Level.SEVERE, message);
- }
- UpdateProcess.this.currentPlayer = null;
- }
+ @Override
+ public void onWorkAbort(final String 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)
- {
- 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();
+ @Override
+ public void onWorkDone(final String 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;
}
if (updateCheck.getResult() == UpdateCheck.CheckResult.NEW_ESS_BUKKIT)
@@ -142,13 +140,16 @@ public class UpdateProcess implements Listener
switch (result)
{
case NEW_ESS:
- player.sendMessage("The new version " + updateCheck.getNewVersion().toString() + " for Essentials is available. Please type /essentialsupdate to update.");
+ player.sendMessage(
+ "The new version " + updateCheck.getNewVersion().toString() + " for Essentials is available. Please type /essentialsupdate to update.");
break;
case NEW_BUKKIT:
- player.sendMessage("Your bukkit version is not the recommended build for Essentials, please update to version " + updateCheck.getNewBukkitVersion() + ".");
+ player.sendMessage(
+ "Your bukkit version is not the recommended build for Essentials, please update to version " + updateCheck.getNewBukkitVersion() + ".");
break;
case NEW_ESS_BUKKIT:
- player.sendMessage("There is a new version " + updateCheck.getNewVersion().toString() + " of Essentials for Bukkit " + updateCheck.getNewBukkitVersion());
+ player.sendMessage(
+ "There is a new version " + updateCheck.getNewVersion().toString() + " of Essentials for Bukkit " + updateCheck.getNewBukkitVersion());
break;
default:
}
@@ -187,7 +188,8 @@ public class UpdateProcess implements Listener
private void startWork()
{
currentPlayer.sendMessage("Installation wizard done. Starting installation.");
- Bukkit.getScheduler().scheduleSyncDelayedTask(plugin, new Runnable()
+ Bukkit.getScheduler().scheduleSyncDelayedTask(
+ plugin, new Runnable()
{
@Override
public void run()
diff --git a/EssentialsUpdate/src/net/ess3/update/Version.java b/EssentialsUpdate/src/net/ess3/update/Version.java
index 5fc10eb18..ee449186f 100644
--- a/EssentialsUpdate/src/net/ess3/update/Version.java
+++ b/EssentialsUpdate/src/net/ess3/update/Version.java
@@ -30,6 +30,7 @@ public class Version implements Comparable<Version>
{
return type;
}
+
private final transient int major;
private final transient int minor;
private final transient int build;
diff --git a/EssentialsUpdate/src/net/ess3/update/chat/AbstractFileCommand.java b/EssentialsUpdate/src/net/ess3/update/chat/AbstractFileCommand.java
index 2e6d44f20..d01d0790f 100644
--- a/EssentialsUpdate/src/net/ess3/update/chat/AbstractFileCommand.java
+++ b/EssentialsUpdate/src/net/ess3/update/chat/AbstractFileCommand.java
@@ -1,11 +1,9 @@
package net.ess3.update.chat;
-import net.ess3.update.PastieUpload;
import java.io.*;
import java.nio.charset.Charset;
-
-import net.ess3.update.PastieUpload;
import org.bukkit.plugin.Plugin;
+import net.ess3.update.PastieUpload;
public abstract class AbstractFileCommand implements Command
diff --git a/EssentialsUpdate/src/net/ess3/update/chat/IrcBot.java b/EssentialsUpdate/src/net/ess3/update/chat/IrcBot.java
index 10ce9ad8a..348a9ae44 100644
--- a/EssentialsUpdate/src/net/ess3/update/chat/IrcBot.java
+++ b/EssentialsUpdate/src/net/ess3/update/chat/IrcBot.java
@@ -94,9 +94,8 @@ public class IrcBot extends PircBot
}
@Override
- protected void onKick(final String channel, final String kickerNick,
- final String kickerLogin, final String kickerHostname,
- final String recipientNick, final String reason)
+ protected void onKick(
+ final String channel, final String kickerNick, final String kickerLogin, final String kickerHostname, final String recipientNick, final String reason)
{
if (recipientNick.equals(getNick()))
{
@@ -112,33 +111,29 @@ public class IrcBot extends PircBot
}
@Override
- protected void onMessage(final String channel, final String sender,
- final String login, final String hostname,
- final String message)
+ protected void onMessage(
+ final String channel, final String sender, final String login, final String hostname, final String message)
{
player.sendMessage(formatChatMessage(sender, message, false));
}
@Override
- protected void onAction(final String sender, final String login,
- final String hostname, final String target,
- final String action)
+ protected void onAction(
+ final String sender, final String login, final String hostname, final String target, final String action)
{
player.sendMessage(formatChatMessage(sender, action, true));
}
@Override
- protected void onNotice(final String sourceNick, final String sourceLogin,
- final String sourceHostname, final String target,
- final String notice)
+ protected void onNotice(
+ final String sourceNick, final String sourceLogin, final String sourceHostname, final String target, final String notice)
{
player.sendMessage(formatChatMessage(sourceNick, notice, false));
}
@Override
- protected void onTopic(final String channel, final String topic,
- final String setBy, final long date,
- final boolean changed)
+ protected void onTopic(
+ final String channel, final String topic, final String setBy, final long date, final boolean changed)
{
player.sendMessage(formatChatMessage(channel, topic, false));
}
diff --git a/EssentialsUpdate/src/net/ess3/update/states/AbstractState.java b/EssentialsUpdate/src/net/ess3/update/states/AbstractState.java
index 5d4e03a2c..ba202c1ff 100644
--- a/EssentialsUpdate/src/net/ess3/update/states/AbstractState.java
+++ b/EssentialsUpdate/src/net/ess3/update/states/AbstractState.java
@@ -1,8 +1,7 @@
package net.ess3.update.states;
-import net.ess3.update.AbstractWorkListener;
-import net.ess3.update.AbstractWorkListener;
import org.bukkit.entity.Player;
+import net.ess3.update.AbstractWorkListener;
public abstract class AbstractState
@@ -66,11 +65,8 @@ public abstract class AbstractState
public final AbstractState reactOnAnswer(final Player sender, final String answer)
{
final String trimmedAnswer = answer.trim();
- if (trimmedAnswer.equalsIgnoreCase("quit")
- || trimmedAnswer.equalsIgnoreCase("bye")
- || trimmedAnswer.equalsIgnoreCase("abort")
- || trimmedAnswer.equalsIgnoreCase("cancel")
- || trimmedAnswer.equalsIgnoreCase("exit"))
+ if (trimmedAnswer.equalsIgnoreCase("quit") || trimmedAnswer.equalsIgnoreCase("bye") || trimmedAnswer.equalsIgnoreCase(
+ "abort") || trimmedAnswer.equalsIgnoreCase("cancel") || trimmedAnswer.equalsIgnoreCase("exit"))
{
abort();
return null;
diff --git a/EssentialsUpdate/src/net/ess3/update/states/AbstractYesNoState.java b/EssentialsUpdate/src/net/ess3/update/states/AbstractYesNoState.java
index 3ee7d0ee2..e84046224 100644
--- a/EssentialsUpdate/src/net/ess3/update/states/AbstractYesNoState.java
+++ b/EssentialsUpdate/src/net/ess3/update/states/AbstractYesNoState.java
@@ -22,22 +22,18 @@ public abstract class AbstractYesNoState extends AbstractState
@Override
public AbstractState getNextState()
{
- return answer
- ? (yesState == null ? null : getState(yesState))
- : (noState == null ? null : getState(noState));
+ return answer ? (yesState == null ? null : getState(yesState)) : (noState == null ? null : getState(noState));
}
@Override
public boolean reactOnAnswer(final String answer)
{
- if (answer.equalsIgnoreCase("yes")
- || answer.equalsIgnoreCase("y"))
+ if (answer.equalsIgnoreCase("yes") || answer.equalsIgnoreCase("y"))
{
this.answer = true;
return true;
}
- if (answer.equalsIgnoreCase("no")
- || answer.equalsIgnoreCase("n"))
+ if (answer.equalsIgnoreCase("no") || answer.equalsIgnoreCase("n"))
{
this.answer = false;
return true;
diff --git a/EssentialsUpdate/src/net/ess3/update/states/Changelog.java b/EssentialsUpdate/src/net/ess3/update/states/Changelog.java
index 42fdc8ca2..033106041 100644
--- a/EssentialsUpdate/src/net/ess3/update/states/Changelog.java
+++ b/EssentialsUpdate/src/net/ess3/update/states/Changelog.java
@@ -1,9 +1,9 @@
package net.ess3.update.states;
-import net.ess3.update.UpdateCheck;
-import net.ess3.update.VersionInfo;
import java.util.List;
import org.bukkit.entity.Player;
+import net.ess3.update.UpdateCheck;
+import net.ess3.update.VersionInfo;
public class Changelog extends AbstractState
diff --git a/EssentialsUpdate/src/net/ess3/update/states/EssentialsChat.java b/EssentialsUpdate/src/net/ess3/update/states/EssentialsChat.java
index a62735f5e..9fa9d763c 100644
--- a/EssentialsUpdate/src/net/ess3/update/states/EssentialsChat.java
+++ b/EssentialsUpdate/src/net/ess3/update/states/EssentialsChat.java
@@ -1,10 +1,10 @@
package net.ess3.update.states;
-import net.ess3.update.AbstractWorkListener;
-import net.ess3.update.tasks.InstallModule;
import org.bukkit.Bukkit;
import org.bukkit.entity.Player;
import org.bukkit.plugin.Plugin;
+import net.ess3.update.AbstractWorkListener;
+import net.ess3.update.tasks.InstallModule;
public class EssentialsChat extends AbstractYesNoState
diff --git a/EssentialsUpdate/src/net/ess3/update/states/EssentialsGeoIP.java b/EssentialsUpdate/src/net/ess3/update/states/EssentialsGeoIP.java
index cd1865b42..7ac34fa22 100644
--- a/EssentialsUpdate/src/net/ess3/update/states/EssentialsGeoIP.java
+++ b/EssentialsUpdate/src/net/ess3/update/states/EssentialsGeoIP.java
@@ -1,11 +1,10 @@
package net.ess3.update.states;
-import net.ess3.update.AbstractWorkListener;
-import net.ess3.update.tasks.InstallModule;
-import net.ess3.update.AbstractWorkListener;
import org.bukkit.Bukkit;
import org.bukkit.entity.Player;
import org.bukkit.plugin.Plugin;
+import net.ess3.update.AbstractWorkListener;
+import net.ess3.update.tasks.InstallModule;
public class EssentialsGeoIP extends AbstractYesNoState
diff --git a/EssentialsUpdate/src/net/ess3/update/states/EssentialsProtect.java b/EssentialsUpdate/src/net/ess3/update/states/EssentialsProtect.java
index bb3a841a7..e2c33cd9b 100644
--- a/EssentialsUpdate/src/net/ess3/update/states/EssentialsProtect.java
+++ b/EssentialsUpdate/src/net/ess3/update/states/EssentialsProtect.java
@@ -1,11 +1,10 @@
package net.ess3.update.states;
-import net.ess3.update.AbstractWorkListener;
-import net.ess3.update.tasks.InstallModule;
-import net.ess3.update.AbstractWorkListener;
import org.bukkit.Bukkit;
import org.bukkit.entity.Player;
import org.bukkit.plugin.Plugin;
+import net.ess3.update.AbstractWorkListener;
+import net.ess3.update.tasks.InstallModule;
public class EssentialsProtect extends AbstractYesNoState
diff --git a/EssentialsUpdate/src/net/ess3/update/states/StateMachine.java b/EssentialsUpdate/src/net/ess3/update/states/StateMachine.java
index b66ca4c58..76bfec87e 100644
--- a/EssentialsUpdate/src/net/ess3/update/states/StateMachine.java
+++ b/EssentialsUpdate/src/net/ess3/update/states/StateMachine.java
@@ -1,13 +1,11 @@
package net.ess3.update.states;
-import net.ess3.update.AbstractWorkListener;
-import net.ess3.update.UpdateCheck;
import java.util.Iterator;
-
-import net.ess3.update.UpdateCheck;
import org.bukkit.Bukkit;
import org.bukkit.entity.Player;
import org.bukkit.plugin.Plugin;
+import net.ess3.update.AbstractWorkListener;
+import net.ess3.update.UpdateCheck;
public class StateMachine extends AbstractWorkListener implements Runnable
@@ -16,6 +14,8 @@ public class StateMachine extends AbstractWorkListener implements Runnable
{
ABORT, WAIT, DONE, NONE
}
+
+
private final transient StateMap states = new StateMap();
private transient AbstractState current;
private transient Player player;
@@ -84,6 +84,7 @@ public class StateMachine extends AbstractWorkListener implements Runnable
}
return result;
}
+
private transient Iterator<AbstractState> iterator;
public void startWork()
@@ -97,7 +98,8 @@ public class StateMachine extends AbstractWorkListener implements Runnable
{
if (!iterator.hasNext())
{
- Bukkit.getScheduler().scheduleSyncDelayedTask(getPlugin(), new Runnable()
+ Bukkit.getScheduler().scheduleSyncDelayedTask(
+ getPlugin(), new Runnable()
{
@Override
public void run()
@@ -120,7 +122,8 @@ public class StateMachine extends AbstractWorkListener implements Runnable
public void onWorkAbort(final String message)
{
finish();
- Bukkit.getScheduler().scheduleSyncDelayedTask(getPlugin(), new Runnable()
+ Bukkit.getScheduler().scheduleSyncDelayedTask(
+ getPlugin(), new Runnable()
{
@Override
public void run()
@@ -136,7 +139,8 @@ public class StateMachine extends AbstractWorkListener implements Runnable
@Override
public void onWorkDone(final String message)
{
- Bukkit.getScheduler().scheduleSyncDelayedTask(getPlugin(), new Runnable()
+ Bukkit.getScheduler().scheduleSyncDelayedTask(
+ getPlugin(), new Runnable()
{
@Override
public void run()
diff --git a/EssentialsUpdate/src/net/ess3/update/states/UpdateOrInstallation.java b/EssentialsUpdate/src/net/ess3/update/states/UpdateOrInstallation.java
index c7bd5127a..4a4b9e862 100644
--- a/EssentialsUpdate/src/net/ess3/update/states/UpdateOrInstallation.java
+++ b/EssentialsUpdate/src/net/ess3/update/states/UpdateOrInstallation.java
@@ -1,8 +1,7 @@
package net.ess3.update.states;
-import net.ess3.update.UpdateCheck;
-import net.ess3.update.UpdateCheck;
import org.bukkit.entity.Player;
+import net.ess3.update.UpdateCheck;
public class UpdateOrInstallation extends AbstractState
diff --git a/EssentialsUpdate/src/net/ess3/update/tasks/InstallModule.java b/EssentialsUpdate/src/net/ess3/update/tasks/InstallModule.java
index 1f7742026..c6df0cae7 100644
--- a/EssentialsUpdate/src/net/ess3/update/tasks/InstallModule.java
+++ b/EssentialsUpdate/src/net/ess3/update/tasks/InstallModule.java
@@ -1,17 +1,13 @@
package net.ess3.update.tasks;
-import net.ess3.update.AbstractWorkListener;
-import net.ess3.update.GetFile;
-import net.ess3.update.AbstractWorkListener;
-import net.ess3.update.GetFile;
-import net.ess3.update.ModuleInfo;
-import net.ess3.update.VersionInfo;
import java.io.File;
import java.net.URL;
import java.util.logging.Level;
-
-import net.ess3.update.VersionInfo;
import org.bukkit.Bukkit;
+import net.ess3.update.AbstractWorkListener;
+import net.ess3.update.GetFile;
+import net.ess3.update.ModuleInfo;
+import net.ess3.update.VersionInfo;
public class InstallModule implements Runnable, Task
diff --git a/EssentialsUpdate/src/net/ess3/update/tasks/SelfUpdate.java b/EssentialsUpdate/src/net/ess3/update/tasks/SelfUpdate.java
index bc0d65b5e..2ff6da55c 100644
--- a/EssentialsUpdate/src/net/ess3/update/tasks/SelfUpdate.java
+++ b/EssentialsUpdate/src/net/ess3/update/tasks/SelfUpdate.java
@@ -1,8 +1,7 @@
package net.ess3.update.tasks;
-import net.ess3.update.AbstractWorkListener;
-import net.ess3.update.AbstractWorkListener;
import org.bukkit.Bukkit;
+import net.ess3.update.AbstractWorkListener;
public class SelfUpdate extends AbstractWorkListener implements Task, Runnable
@@ -25,7 +24,8 @@ public class SelfUpdate extends AbstractWorkListener implements Task, Runnable
public void onWorkDone(final String message)
{
listener.onWorkDone(message);
- Bukkit.getScheduler().scheduleSyncDelayedTask(getPlugin(), new Runnable()
+ Bukkit.getScheduler().scheduleSyncDelayedTask(
+ getPlugin(), new Runnable()
{
@Override
public void run()
@@ -44,7 +44,8 @@ public class SelfUpdate extends AbstractWorkListener implements Task, Runnable
@Override
public void run()
{
- Bukkit.getScheduler().scheduleAsyncDelayedTask(getPlugin(), new Runnable()
+ Bukkit.getScheduler().scheduleAsyncDelayedTask(
+ getPlugin(), new Runnable()
{
@Override
public void run()