diff --git a/src/main/scala/codechicken/core/launch/DepLoader.java b/src/main/scala/codechicken/core/launch/DepLoader.java
index 91c56fc..b164ebd 100644
--- a/src/main/scala/codechicken/core/launch/DepLoader.java
+++ b/src/main/scala/codechicken/core/launch/DepLoader.java
@@ -1,13 +1,5 @@
package codechicken.core.launch;
-import com.google.gson.JsonElement;
-import com.google.gson.JsonObject;
-import com.google.gson.JsonParser;
-import cpw.mods.fml.common.versioning.ComparableVersion;
-import cpw.mods.fml.relauncher.FMLInjectionData;
-import cpw.mods.fml.relauncher.FMLLaunchHandler;
-import cpw.mods.fml.relauncher.IFMLCallHook;
-import cpw.mods.fml.relauncher.IFMLLoadingPlugin;
import java.awt.*;
import java.awt.Dialog.ModalityType;
import java.awt.event.WindowAdapter;
@@ -28,23 +20,37 @@ import java.util.regex.Pattern;
import java.util.regex.PatternSyntaxException;
import java.util.zip.ZipEntry;
import java.util.zip.ZipFile;
+
import javax.swing.*;
import javax.swing.event.HyperlinkEvent;
import javax.swing.event.HyperlinkListener;
+
import net.minecraft.launchwrapper.LaunchClassLoader;
+
import sun.misc.URLClassPath;
import sun.net.util.URLUtil;
+import com.google.gson.JsonElement;
+import com.google.gson.JsonObject;
+import com.google.gson.JsonParser;
+
+import cpw.mods.fml.common.versioning.ComparableVersion;
+import cpw.mods.fml.relauncher.FMLInjectionData;
+import cpw.mods.fml.relauncher.FMLLaunchHandler;
+import cpw.mods.fml.relauncher.IFMLCallHook;
+import cpw.mods.fml.relauncher.IFMLLoadingPlugin;
+
/**
- * For autodownloading stuff.
- * This is really unoriginal, mostly ripped off FML, credits to cpw.
+ * For autodownloading stuff. This is really unoriginal, mostly ripped off FML, credits to cpw.
*/
public class DepLoader implements IFMLLoadingPlugin, IFMLCallHook {
+
private static ByteBuffer downloadBuffer = ByteBuffer.allocateDirect(1 << 23);
private static final String owner = "CB's DepLoader";
private static DepLoadInst inst;
public interface IDownloadDisplay {
+
void resetProgress(int sizeGuess);
void setPokeThread(Thread currentThread);
@@ -62,6 +68,7 @@ public class DepLoader implements IFMLLoadingPlugin, IFMLCallHook {
@SuppressWarnings("serial")
public static class Downloader extends JOptionPane implements IDownloadDisplay {
+
private JDialog container;
private JLabel currentActivity;
private JProgressBar progress;
@@ -71,12 +78,13 @@ public class DepLoader implements IFMLLoadingPlugin, IFMLCallHook {
private Box makeProgressPanel() {
Box box = Box.createVerticalBox();
box.add(Box.createRigidArea(new Dimension(0, 10)));
- JLabel welcomeLabel = new JLabel("" + owner
- + " is setting up your minecraft environment");
+ JLabel welcomeLabel = new JLabel(
+ "" + owner
+ + " is setting up your minecraft environment");
box.add(welcomeLabel);
welcomeLabel.setAlignmentY(LEFT_ALIGNMENT);
- welcomeLabel =
- new JLabel("Please wait, " + owner + " has some tasks to do before you can play");
+ welcomeLabel = new JLabel(
+ "Please wait, " + owner + " has some tasks to do before you can play");
welcomeLabel.setAlignmentY(LEFT_ALIGNMENT);
box.add(welcomeLabel);
box.add(Box.createRigidArea(new Dimension(0, 10)));
@@ -96,8 +104,9 @@ public class DepLoader implements IFMLLoadingPlugin, IFMLCallHook {
setMessageType(JOptionPane.INFORMATION_MESSAGE);
setMessage(makeProgressPanel());
- setOptions(new Object[] {"Stop"});
+ setOptions(new Object[] { "Stop" });
addPropertyChangeListener(new PropertyChangeListener() {
+
@Override
public void propertyChange(PropertyChangeEvent evt) {
if (evt.getSource() == Downloader.this && evt.getPropertyName() == VALUE_PROPERTY) {
@@ -115,6 +124,7 @@ public class DepLoader implements IFMLLoadingPlugin, IFMLCallHook {
container.setVisible(true);
container.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE);
container.addWindowListener(new WindowAdapter() {
+
@Override
public void windowClosing(WindowEvent e) {
requestClose(
@@ -168,21 +178,26 @@ public class DepLoader implements IFMLLoadingPlugin, IFMLCallHook {
JEditorPane ep = new JEditorPane(
"text/html",
"" + owner
- + " was unable to download required library " + name
+ + " was unable to download required library "
+ + name
+ "
Check your internet connection and try restarting or download it manually from"
+ "
" + url + " and put it in your mods folder" + "");
+ + url
+ + "\">"
+ + url
+ + " and put it in your mods folder"
+ + "