update code style

This commit is contained in:
huangyuhui
2016-01-01 11:03:09 +08:00
parent 1f7eb04215
commit b82243a9c0
298 changed files with 3902 additions and 3998 deletions

View File

@@ -151,7 +151,7 @@ public final class Launcher {
int flag = 0; int flag = 0;
try { try {
minecraftMain.invoke(null, new Object[]{(String[]) cmdList.toArray(new String[cmdList.size()])}); minecraftMain.invoke(null, new Object[] { (String[]) cmdList.toArray(new String[cmdList.size()]) });
} catch (Throwable throwable) { } catch (Throwable throwable) {
String trace = StrUtils.getStackTrace(throwable); String trace = StrUtils.getStackTrace(throwable);
final String advice = MinecraftCrashAdvicer.getAdvice(trace); final String advice = MinecraftCrashAdvicer.getAdvice(trace);
@@ -174,15 +174,16 @@ public final class Launcher {
} }
} }
/* /*
static Object getShutdownHaltLock() { * static Object getShutdownHaltLock() {
try { * try {
Class z = Class.forName("java.lang.Shutdown"); * Class z = Class.forName("java.lang.Shutdown");
Field haltLock = z.getDeclaredField("haltLock"); * Field haltLock = z.getDeclaredField("haltLock");
haltLock.setAccessible(true); * haltLock.setAccessible(true);
return haltLock.get(null); * return haltLock.get(null);
} catch (Throwable ex) { * } catch (Throwable ex) {
ex.printStackTrace(); * ex.printStackTrace();
return new Object(); * return new Object();
} * }
}*/ * }
*/
} }

View File

@@ -76,7 +76,7 @@ public final class Main implements Runnable {
try { try {
sslContext = SSLContext.getInstance("TLS"); sslContext = SSLContext.getInstance("TLS");
X509TrustManager[] xtmArray = new X509TrustManager[]{XTM}; X509TrustManager[] xtmArray = new X509TrustManager[] { XTM };
sslContext.init(null, xtmArray, new java.security.SecureRandom()); sslContext.init(null, xtmArray, new java.security.SecureRandom());
} catch (GeneralSecurityException gse) { } catch (GeneralSecurityException gse) {
} }
@@ -112,7 +112,7 @@ public final class Main implements Runnable {
public static final Main INSTANCE = new Main(); public static final Main INSTANCE = new Main();
public static HelloMinecraftLookAndFeel LOOK_AND_FEEL; public static HelloMinecraftLookAndFeel LOOK_AND_FEEL;
@SuppressWarnings({"CallToPrintStackTrace", "UseSpecificCatch"}) @SuppressWarnings({ "CallToPrintStackTrace", "UseSpecificCatch" })
public static void main(String[] args) { public static void main(String[] args) {
{ {
//PluginManager.getServerPlugin(); //PluginManager.getServerPlugin();
@@ -147,7 +147,7 @@ public final class Main implements Runnable {
Settings.UPDATE_CHECKER.outdated.register(IUpgrader.NOW_UPGRADER); Settings.UPDATE_CHECKER.outdated.register(IUpgrader.NOW_UPGRADER);
Settings.UPDATE_CHECKER.process(false).subscribeOn(Schedulers.newThread()).subscribe(t Settings.UPDATE_CHECKER.process(false).subscribeOn(Schedulers.newThread()).subscribe(t
-> Main.invokeUpdate()); -> Main.invokeUpdate());
if (StrUtils.isNotBlank(Settings.getInstance().getProxyHost()) && StrUtils.isNotBlank(Settings.getInstance().getProxyPort()) && MathUtils.canParseInt(Settings.getInstance().getProxyPort())) { if (StrUtils.isNotBlank(Settings.getInstance().getProxyHost()) && StrUtils.isNotBlank(Settings.getInstance().getProxyPort()) && MathUtils.canParseInt(Settings.getInstance().getProxyPort())) {
HMCLog.log("Initializing customized proxy"); HMCLog.log("Initializing customized proxy");

View File

@@ -34,6 +34,7 @@ public interface IPlugin {
* You can modify the application actions by this method. * You can modify the application actions by this method.
* *
* @param profile info to the Minecraft Loader * @param profile info to the Minecraft Loader
*
* @return For example, you can implement IMinecraftProvider to support * @return For example, you can implement IMinecraftProvider to support
* MultiMC * MultiMC
*/ */

View File

@@ -1,7 +1,7 @@
/* /*
* Hello Minecraft! Launcher. * Hello Minecraft! Launcher.
* Copyright (C) 2013 huangyuhui * Copyright (C) 2013 huangyuhui
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or * the Free Software Foundation, either version 3 of the License, or
@@ -18,7 +18,6 @@
package org.jackhuang.hellominecraft.launcher.launch; package org.jackhuang.hellominecraft.launcher.launch;
import java.io.IOException; import java.io.IOException;
import javax.swing.SwingUtilities;
import org.jackhuang.hellominecraft.C; import org.jackhuang.hellominecraft.C;
import org.jackhuang.hellominecraft.HMCLog; import org.jackhuang.hellominecraft.HMCLog;
import org.jackhuang.hellominecraft.launcher.launch.GameLauncher.DownloadLibraryJob; import org.jackhuang.hellominecraft.launcher.launch.GameLauncher.DownloadLibraryJob;

View File

@@ -111,7 +111,7 @@ public class GameLauncher {
return null; return null;
} }
List<String> lst = null; List<String> lst;
try { try {
lst = loader.makeLaunchingCommand(); lst = loader.makeLaunchingCommand();
} catch (Exception e) { } catch (Exception e) {
@@ -146,7 +146,7 @@ public class GameLauncher {
if (get == null || get.getSelectedMinecraftVersion() == null || StrUtils.isBlank(get.getCanonicalGameDir())) if (get == null || get.getSelectedMinecraftVersion() == null || StrUtils.isBlank(get.getCanonicalGameDir()))
throw new Error("Fucking bug!"); throw new Error("Fucking bug!");
builder.directory(provider.getRunDirectory(get.getSelectedMinecraftVersion().id)) builder.directory(provider.getRunDirectory(get.getSelectedMinecraftVersion().id))
.environment().put("APPDATA", get.getCanonicalGameDir()); .environment().put("APPDATA", get.getCanonicalGameDir());
JavaProcess jp = new JavaProcess(str, builder.start(), PROCESS_MANAGER); JavaProcess jp = new JavaProcess(str, builder.start(), PROCESS_MANAGER);
launchEvent.execute(jp); launchEvent.execute(jp);
} catch (Exception e) { } catch (Exception e) {
@@ -159,7 +159,7 @@ public class GameLauncher {
* According to the name... * According to the name...
* *
* @param launcherName the name of launch bat/sh * @param launcherName the name of launch bat/sh
* @param str launch command * @param str launch command
* *
* @return launcher location * @return launcher location
* *

View File

@@ -1,7 +1,7 @@
/* /*
* Hello Minecraft! Launcher. * Hello Minecraft! Launcher.
* Copyright (C) 2013 huangyuhui <huanghongxun2008@126.com> * Copyright (C) 2013 huangyuhui <huanghongxun2008@126.com>
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or * the Free Software Foundation, either version 3 of the License, or
@@ -27,11 +27,11 @@ import org.jackhuang.hellominecraft.tasks.Task;
* @author huangyuhui * @author huangyuhui
*/ */
public abstract class IMinecraftAssetService extends IMinecraftService { public abstract class IMinecraftAssetService extends IMinecraftService {
public IMinecraftAssetService(Profile profile) { public IMinecraftAssetService(Profile profile) {
super(profile); super(profile);
} }
public abstract Task downloadAssets(String mcVersion); public abstract Task downloadAssets(String mcVersion);
public abstract File getAssets(); public abstract File getAssets();
@@ -44,8 +44,8 @@ public abstract class IMinecraftAssetService extends IMinecraftService {
* @return Is the action successful? * @return Is the action successful?
*/ */
public abstract boolean refreshAssetsIndex(String a); public abstract boolean refreshAssetsIndex(String a);
public abstract boolean downloadMinecraftAssetsIndex(String assetsId); public abstract boolean downloadMinecraftAssetsIndex(String assetsId);
public abstract File getAssetObject(String assetVersion, String name) throws IOException; public abstract File getAssetObject(String assetVersion, String name) throws IOException;
} }

View File

@@ -1,7 +1,7 @@
/* /*
* Hello Minecraft! Launcher. * Hello Minecraft! Launcher.
* Copyright (C) 2013 huangyuhui <huanghongxun2008@126.com> * Copyright (C) 2013 huangyuhui <huanghongxun2008@126.com>
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or * the Free Software Foundation, either version 3 of the License, or
@@ -38,8 +38,6 @@ public abstract class IMinecraftDownloadService extends IMinecraftService {
public abstract boolean downloadMinecraftJar(String id); public abstract boolean downloadMinecraftJar(String id);
public abstract boolean downloadMinecraftVersionJson(String id); public abstract boolean downloadMinecraftVersionJson(String id);
/** /**
* Get the libraries that need to download. * Get the libraries that need to download.
@@ -56,7 +54,7 @@ public abstract class IMinecraftDownloadService extends IMinecraftService {
* @return Is the action successful? * @return Is the action successful?
*/ */
public abstract boolean install(String version); public abstract boolean install(String version);
public abstract Observable<MinecraftRemoteVersion> getRemoteVersions(); public abstract Observable<MinecraftRemoteVersion> getRemoteVersions();
} }

View File

@@ -74,6 +74,7 @@ public abstract class IMinecraftProvider {
/** /**
* *
* @param v should be resolved * @param v should be resolved
*
* @return libraries of resolved minecraft version v. * @return libraries of resolved minecraft version v.
*/ */
public abstract GameLauncher.DecompressLibraryJob getDecompressLibraries(MinecraftVersion v); public abstract GameLauncher.DecompressLibraryJob getDecompressLibraries(MinecraftVersion v);
@@ -106,7 +107,7 @@ public abstract class IMinecraftProvider {
* Rename version * Rename version
* *
* @param from The old name * @param from The old name
* @param to The new name * @param to The new name
* *
* @return Is the action successful? * @return Is the action successful?
*/ */

View File

@@ -1,7 +1,7 @@
/* /*
* Hello Minecraft! Launcher. * Hello Minecraft! Launcher.
* Copyright (C) 2013 huangyuhui <huanghongxun2008@126.com> * Copyright (C) 2013 huangyuhui <huanghongxun2008@126.com>
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or * the Free Software Foundation, either version 3 of the License, or
@@ -24,10 +24,11 @@ import org.jackhuang.hellominecraft.launcher.settings.Profile;
* @author huangyuhui * @author huangyuhui
*/ */
public abstract class IMinecraftService { public abstract class IMinecraftService {
public Profile profile; public Profile profile;
public IMinecraftService(Profile profile) { public IMinecraftService(Profile profile) {
this.profile = profile; this.profile = profile;
} }
} }

View File

@@ -1,7 +1,7 @@
/* /*
* Hello Minecraft! Launcher. * Hello Minecraft! Launcher.
* Copyright (C) 2013 huangyuhui * Copyright (C) 2013 huangyuhui
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or * the Free Software Foundation, either version 3 of the License, or
@@ -76,7 +76,7 @@ public class LibraryDownloadTask extends FileDownloadTask {
@SuppressWarnings("UnusedAssignment") @SuppressWarnings("UnusedAssignment")
public static void unpackLibrary(File output, File input) public static void unpackLibrary(File output, File input)
throws IOException { throws IOException {
HMCLog.log("Unpacking " + input); HMCLog.log("Unpacking " + input);
if (output.exists()) if (output.exists())
output.delete(); output.delete();

View File

@@ -1,7 +1,7 @@
/* /*
* Hello Minecraft! Launcher. * Hello Minecraft! Launcher.
* Copyright (C) 2013 huangyuhui * Copyright (C) 2013 huangyuhui
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or * the Free Software Foundation, either version 3 of the License, or

View File

@@ -1,7 +1,7 @@
/* /*
* Hello Minecraft! Launcher. * Hello Minecraft! Launcher.
* Copyright (C) 2013 huangyuhui * Copyright (C) 2013 huangyuhui
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or * the Free Software Foundation, either version 3 of the License, or

View File

@@ -1,7 +1,7 @@
/* /*
* Hello Minecraft! Launcher. * Hello Minecraft! Launcher.
* Copyright (C) 2013 huangyuhui <huanghongxun2008@126.com> * Copyright (C) 2013 huangyuhui <huanghongxun2008@126.com>
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or * the Free Software Foundation, either version 3 of the License, or

View File

@@ -1,7 +1,7 @@
/* /*
* Hello Minecraft! Launcher. * Hello Minecraft! Launcher.
* Copyright (C) 2013 huangyuhui <huanghongxun2008@126.com> * Copyright (C) 2013 huangyuhui <huanghongxun2008@126.com>
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or * the Free Software Foundation, either version 3 of the License, or
@@ -33,21 +33,21 @@ public final class MCUtils {
String userhome = System.getProperty("user.home", "."); String userhome = System.getProperty("user.home", ".");
File file; File file;
switch (OS.os()) { switch (OS.os()) {
case LINUX: case LINUX:
file = new File(userhome, '.' + baseName + '/');
break;
case WINDOWS:
String appdata = System.getenv("APPDATA");
if (appdata != null)
file = new File(appdata, "." + baseName + '/');
else
file = new File(userhome, '.' + baseName + '/'); file = new File(userhome, '.' + baseName + '/');
break; break;
case WINDOWS: case OSX:
String appdata = System.getenv("APPDATA"); file = new File(userhome, "Library/Application Support/" + baseName);
if (appdata != null) break;
file = new File(appdata, "." + baseName + '/'); default:
else file = new File(userhome, baseName + '/');
file = new File(userhome, '.' + baseName + '/');
break;
case OSX:
file = new File(userhome, "Library/Application Support/" + baseName);
break;
default:
file = new File(userhome, baseName + '/');
} }
return file; return file;
} }

View File

@@ -112,8 +112,8 @@ public class ModInfo implements Comparable<ModInfo> {
ModInfo i = new ModInfo(); ModInfo i = new ModInfo();
i.location = f; i.location = f;
List<ModInfo> m = C.gson.fromJson(new InputStreamReader(jar.getInputStream(entry)), List<ModInfo> m = C.gson.fromJson(new InputStreamReader(jar.getInputStream(entry)),
new TypeToken<List<ModInfo>>() { new TypeToken<List<ModInfo>>() {
}.getType()); }.getType());
if (m != null && m.size() > 0) { if (m != null && m.size() > 0) {
i = m.get(0); i = m.get(0);
i.location = f; i.location = f;
@@ -123,7 +123,7 @@ public class ModInfo implements Comparable<ModInfo> {
private static ModInfo getLiteLoaderModInfo(File f, ZipFile jar, ZipEntry entry) throws IOException { private static ModInfo getLiteLoaderModInfo(File f, ZipFile jar, ZipEntry entry) throws IOException {
ModInfo m = C.gson.fromJson(new InputStreamReader(jar.getInputStream(entry)), ModInfo m = C.gson.fromJson(new InputStreamReader(jar.getInputStream(entry)),
ModInfo.class); ModInfo.class);
if (m == null) if (m == null)
m = new ModInfo(); m = new ModInfo();
m.location = f; m.location = f;

View File

@@ -1,7 +1,7 @@
/* /*
* Hello Minecraft! Launcher. * Hello Minecraft! Launcher.
* Copyright (C) 2013 huangyuhui * Copyright (C) 2013 huangyuhui
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or * the Free Software Foundation, either version 3 of the License, or

View File

@@ -1,7 +1,7 @@
/* /*
* Hello Minecraft! Launcher. * Hello Minecraft! Launcher.
* Copyright (C) 2013 huangyuhui <huanghongxun2008@126.com> * Copyright (C) 2013 huangyuhui <huanghongxun2008@126.com>
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or * the Free Software Foundation, either version 3 of the License, or

View File

@@ -1,7 +1,7 @@
/* /*
* Hello Minecraft! Launcher. * Hello Minecraft! Launcher.
* Copyright (C) 2013 huangyuhui <huanghongxun2008@126.com> * Copyright (C) 2013 huangyuhui <huanghongxun2008@126.com>
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or * the Free Software Foundation, either version 3 of the License, or
@@ -17,7 +17,6 @@
*/ */
package org.jackhuang.hellominecraft.launcher.utils.assets; package org.jackhuang.hellominecraft.launcher.utils.assets;
/** /**
* *
* @author huangyuhui * @author huangyuhui

View File

@@ -1,7 +1,7 @@
/* /*
* Hello Minecraft! Launcher. * Hello Minecraft! Launcher.
* Copyright (C) 2013 huangyuhui <huanghongxun2008@126.com> * Copyright (C) 2013 huangyuhui <huanghongxun2008@126.com>
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or * the Free Software Foundation, either version 3 of the License, or

View File

@@ -1,7 +1,7 @@
/* /*
* Hello Minecraft! Launcher. * Hello Minecraft! Launcher.
* Copyright (C) 2013 huangyuhui <huanghongxun2008@126.com> * Copyright (C) 2013 huangyuhui <huanghongxun2008@126.com>
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or * the Free Software Foundation, either version 3 of the License, or

View File

@@ -1,7 +1,7 @@
/* /*
* Hello Minecraft! Launcher. * Hello Minecraft! Launcher.
* Copyright (C) 2013 huangyuhui <huanghongxun2008@126.com> * Copyright (C) 2013 huangyuhui <huanghongxun2008@126.com>
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or * the Free Software Foundation, either version 3 of the License, or

View File

@@ -1,7 +1,7 @@
/* /*
* Hello Minecraft! Launcher. * Hello Minecraft! Launcher.
* Copyright (C) 2013 huangyuhui <huanghongxun2008@126.com> * Copyright (C) 2013 huangyuhui <huanghongxun2008@126.com>
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or * the Free Software Foundation, either version 3 of the License, or
@@ -48,29 +48,29 @@ public final class BestLogin extends IAuthenticator {
InputStream is = socket.getInputStream(); InputStream is = socket.getInputStream();
int code = is.read(); int code = is.read();
switch (code) { switch (code) {
case -1: case -1:
throw new AuthenticationException("internet error."); throw new AuthenticationException("internet error.");
case 200: case 200:
throw new AuthenticationException("server restarting."); throw new AuthenticationException("server restarting.");
case 255: case 255:
throw new AuthenticationException("unknown error"); throw new AuthenticationException("unknown error");
case 3: case 3:
throw new AuthenticationException("unregistered."); throw new AuthenticationException("unregistered.");
case 50: case 50:
throw new AuthenticationException("please update your launcher and act your account."); throw new AuthenticationException("please update your launcher and act your account.");
case 2: case 2:
throw new AuthenticationException("wrong password."); throw new AuthenticationException("wrong password.");
case 100: case 100:
throw new AuthenticationException("server reloading."); throw new AuthenticationException("server reloading.");
case 0: case 0:
byte[] b = new byte[64]; byte[] b = new byte[64];
is.read(b, 0, b.length); is.read(b, 0, b.length);
String[] ss = new String(b).split(":"); String[] ss = new String(b).split(":");
lr.setUserName(info.username); lr.setUserName(info.username);
lr.setUserId(ss[1]); lr.setUserId(ss[1]);
lr.setSession(ss[0]); lr.setSession(ss[0]);
lr.setAccessToken(ss[0]); lr.setAccessToken(ss[0]);
break; break;
} }
lr.setUserType("Legacy"); lr.setUserType("Legacy");
return lr; return lr;

View File

@@ -46,6 +46,7 @@ public abstract class IAuthenticator {
* @param info username & password * @param info username & password
* *
* @return login result * @return login result
*
* @throws * @throws
* org.jackhuang.hellominecraft.launcher.utils.auth.AuthenticationException * org.jackhuang.hellominecraft.launcher.utils.auth.AuthenticationException
*/ */

View File

@@ -1,7 +1,7 @@
/* /*
* Hello Minecraft! Launcher. * Hello Minecraft! Launcher.
* Copyright (C) 2013 huangyuhui <huanghongxun2008@126.com> * Copyright (C) 2013 huangyuhui <huanghongxun2008@126.com>
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or * the Free Software Foundation, either version 3 of the License, or

View File

@@ -1,7 +1,7 @@
/* /*
* Hello Minecraft! Launcher. * Hello Minecraft! Launcher.
* Copyright (C) 2013 huangyuhui <huanghongxun2008@126.com> * Copyright (C) 2013 huangyuhui <huanghongxun2008@126.com>
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or * the Free Software Foundation, either version 3 of the License, or

View File

@@ -1,7 +1,7 @@
/* /*
* Hello Minecraft! Launcher. * Hello Minecraft! Launcher.
* Copyright (C) 2013 huangyuhui <huanghongxun2008@126.com> * Copyright (C) 2013 huangyuhui <huanghongxun2008@126.com>
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or * the Free Software Foundation, either version 3 of the License, or

View File

@@ -1,7 +1,7 @@
/* /*
* Hello Minecraft! Launcher. * Hello Minecraft! Launcher.
* Copyright (C) 2013 huangyuhui <huanghongxun2008@126.com> * Copyright (C) 2013 huangyuhui <huanghongxun2008@126.com>
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or * the Free Software Foundation, either version 3 of the License, or

View File

@@ -1,7 +1,7 @@
/* /*
* Hello Minecraft! Launcher. * Hello Minecraft! Launcher.
* Copyright (C) 2013 huangyuhui <huanghongxun2008@126.com> * Copyright (C) 2013 huangyuhui <huanghongxun2008@126.com>
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or * the Free Software Foundation, either version 3 of the License, or

View File

@@ -1,7 +1,7 @@
/* /*
* Hello Minecraft! Launcher. * Hello Minecraft! Launcher.
* Copyright (C) 2013 huangyuhui <huanghongxun2008@126.com> * Copyright (C) 2013 huangyuhui <huanghongxun2008@126.com>
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or * the Free Software Foundation, either version 3 of the License, or
@@ -96,7 +96,7 @@ public class PropertyMap extends HashMap<String, Property> {
} }
public static class LegacySerializer public static class LegacySerializer
implements JsonSerializer<PropertyMap> { implements JsonSerializer<PropertyMap> {
@Override @Override
public JsonElement serialize(PropertyMap src, Type typeOfSrc, JsonSerializationContext context) { public JsonElement serialize(PropertyMap src, Type typeOfSrc, JsonSerializationContext context) {

View File

@@ -1,7 +1,7 @@
/* /*
* Hello Minecraft! Launcher. * Hello Minecraft! Launcher.
* Copyright (C) 2013 huangyuhui <huanghongxun2008@126.com> * Copyright (C) 2013 huangyuhui <huanghongxun2008@126.com>
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or * the Free Software Foundation, either version 3 of the License, or

View File

@@ -1,7 +1,7 @@
/* /*
* Hello Minecraft! Launcher. * Hello Minecraft! Launcher.
* Copyright (C) 2013 huangyuhui <huanghongxun2008@126.com> * Copyright (C) 2013 huangyuhui <huanghongxun2008@126.com>
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or * the Free Software Foundation, either version 3 of the License, or

View File

@@ -1,7 +1,7 @@
/* /*
* Hello Minecraft! Launcher. * Hello Minecraft! Launcher.
* Copyright (C) 2013 huangyuhui <huanghongxun2008@126.com> * Copyright (C) 2013 huangyuhui <huanghongxun2008@126.com>
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or * the Free Software Foundation, either version 3 of the License, or

View File

@@ -1,7 +1,7 @@
/* /*
* Hello Minecraft! Launcher. * Hello Minecraft! Launcher.
* Copyright (C) 2013 huangyuhui <huanghongxun2008@126.com> * Copyright (C) 2013 huangyuhui <huanghongxun2008@126.com>
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or * the Free Software Foundation, either version 3 of the License, or

View File

@@ -1,7 +1,7 @@
/* /*
* Hello Minecraft! Launcher. * Hello Minecraft! Launcher.
* Copyright (C) 2013 huangyuhui <huanghongxun2008@126.com> * Copyright (C) 2013 huangyuhui <huanghongxun2008@126.com>
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or * the Free Software Foundation, either version 3 of the License, or
@@ -36,9 +36,9 @@ import org.jackhuang.hellominecraft.utils.StrUtils;
public class YggdrasilAuthentication { public class YggdrasilAuthentication {
public static final Gson GSON = new GsonBuilder() public static final Gson GSON = new GsonBuilder()
.registerTypeAdapter(GameProfile.class, new GameProfile.GameProfileSerializer()) .registerTypeAdapter(GameProfile.class, new GameProfile.GameProfileSerializer())
.registerTypeAdapter(PropertyMap.class, new PropertyMap.Serializer()) .registerTypeAdapter(PropertyMap.class, new PropertyMap.Serializer())
.registerTypeAdapter(UUID.class, new UUIDTypeAdapter()).create(); .registerTypeAdapter(UUID.class, new UUIDTypeAdapter()).create();
protected static final String BASE_URL = "https://authserver.mojang.com/"; protected static final String BASE_URL = "https://authserver.mojang.com/";
protected static final URL ROUTE_AUTHENTICATE = NetUtils.constantURL(BASE_URL + "authenticate"); protected static final URL ROUTE_AUTHENTICATE = NetUtils.constantURL(BASE_URL + "authenticate");
@@ -134,7 +134,7 @@ public class YggdrasilAuthentication {
else else
throw new AuthenticationException(C.i18n("login.invalid_password")); throw new AuthenticationException(C.i18n("login.invalid_password"));
} }
private void loggedIn(URL url, Object input) throws AuthenticationException { private void loggedIn(URL url, Object input) throws AuthenticationException {
try { try {
String jsonResult = input == null ? NetUtils.get(url) : NetUtils.post(url, GSON.toJson(input), "application/json", proxy); String jsonResult = input == null ? NetUtils.get(url) : NetUtils.post(url, GSON.toJson(input), "application/json", proxy);

View File

@@ -1,7 +1,7 @@
/* /*
* Hello Minecraft! Launcher. * Hello Minecraft! Launcher.
* Copyright (C) 2013 huangyuhui <huanghongxun2008@126.com> * Copyright (C) 2013 huangyuhui <huanghongxun2008@126.com>
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or * the Free Software Foundation, either version 3 of the License, or

View File

@@ -1,7 +1,7 @@
/* /*
* Hello Minecraft! Launcher. * Hello Minecraft! Launcher.
* Copyright (C) 2013 huangyuhui <huanghongxun2008@126.com> * Copyright (C) 2013 huangyuhui <huanghongxun2008@126.com>
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or * the Free Software Foundation, either version 3 of the License, or

View File

@@ -1,7 +1,7 @@
/* /*
* Hello Minecraft! Launcher. * Hello Minecraft! Launcher.
* Copyright (C) 2013 huangyuhui <huanghongxun2008@126.com> * Copyright (C) 2013 huangyuhui <huanghongxun2008@126.com>
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or * the Free Software Foundation, either version 3 of the License, or
@@ -27,7 +27,7 @@ import org.jackhuang.hellominecraft.launcher.utils.installers.InstallerVersionLi
public abstract class IDownloadProvider { public abstract class IDownloadProvider {
public InstallerVersionList getInstallerByType(InstallerType type) { public InstallerVersionList getInstallerByType(InstallerType type) {
switch(type) { switch (type) {
case Forge: case Forge:
return getForgeInstaller(); return getForgeInstaller();
case LiteLoader: case LiteLoader:
@@ -38,7 +38,7 @@ public abstract class IDownloadProvider {
return null; return null;
} }
} }
public abstract InstallerVersionList getForgeInstaller(); public abstract InstallerVersionList getForgeInstaller();
public abstract InstallerVersionList getLiteLoaderInstaller(); public abstract InstallerVersionList getLiteLoaderInstaller();

View File

@@ -1,7 +1,7 @@
/* /*
* Hello Minecraft! Launcher. * Hello Minecraft! Launcher.
* Copyright (C) 2013 huangyuhui <huanghongxun2008@126.com> * Copyright (C) 2013 huangyuhui <huanghongxun2008@126.com>
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or * the Free Software Foundation, either version 3 of the License, or

View File

@@ -1,7 +1,7 @@
/* /*
* Hello Minecraft! Launcher. * Hello Minecraft! Launcher.
* Copyright (C) 2013 huangyuhui <huanghongxun2008@126.com> * Copyright (C) 2013 huangyuhui <huanghongxun2008@126.com>
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or * the Free Software Foundation, either version 3 of the License, or

View File

@@ -1,7 +1,7 @@
/* /*
* Hello Minecraft! Launcher. * Hello Minecraft! Launcher.
* Copyright (C) 2013 huangyuhui <huanghongxun2008@126.com> * Copyright (C) 2013 huangyuhui <huanghongxun2008@126.com>
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or * the Free Software Foundation, either version 3 of the License, or

View File

@@ -1,7 +1,7 @@
/* /*
* Hello Minecraft! Launcher. * Hello Minecraft! Launcher.
* Copyright (C) 2013 huangyuhui <huanghongxun2008@126.com> * Copyright (C) 2013 huangyuhui <huanghongxun2008@126.com>
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or * the Free Software Foundation, either version 3 of the License, or
@@ -42,17 +42,17 @@ public final class InstallerService {
public InstallerService(Profile p) { public InstallerService(Profile p) {
this.p = p; this.p = p;
} }
public Task download(InstallerVersion v, InstallerType type) { public Task download(InstallerVersion v, InstallerType type) {
switch(type) { switch (type) {
case Forge: case Forge:
return downloadForge(v); return downloadForge(v);
case Optifine: case Optifine:
return downloadOptifine(v); return downloadOptifine(v);
case LiteLoader: case LiteLoader:
return downloadLiteLoader(v); return downloadLiteLoader(v);
default: default:
return null; return null;
} }
} }
@@ -63,9 +63,9 @@ public final class InstallerService {
File filepath = IOUtils.tryGetCanonicalFile(IOUtils.currentDirWithSeparator() + "forge-installer.jar"); File filepath = IOUtils.tryGetCanonicalFile(IOUtils.currentDirWithSeparator() + "forge-installer.jar");
if (v.installer != null) if (v.installer != null)
TaskWindow.getInstance() TaskWindow.getInstance()
.addTask(new FileDownloadTask(p.getDownloadType().getProvider().getParsedLibraryDownloadURL(v.installer), filepath).setTag("forge")) .addTask(new FileDownloadTask(p.getDownloadType().getProvider().getParsedLibraryDownloadURL(v.installer), filepath).setTag("forge"))
.addTask(new ForgeInstaller(p.getMinecraftProvider(), filepath, v)) .addTask(new ForgeInstaller(p.getMinecraftProvider(), filepath, v))
.start(); .start();
} }
}; };
} }
@@ -78,9 +78,9 @@ public final class InstallerService {
if (v.installer != null) { if (v.installer != null) {
OptiFineDownloadFormatter task = new OptiFineDownloadFormatter(v.installer); OptiFineDownloadFormatter task = new OptiFineDownloadFormatter(v.installer);
TaskWindow.getInstance().addTask(task) TaskWindow.getInstance().addTask(task)
.addTask(new FileDownloadTask(filepath).registerPreviousResult(task).setTag("optifine")) .addTask(new FileDownloadTask(filepath).registerPreviousResult(task).setTag("optifine"))
.addTask(new OptiFineInstaller(p, v.selfVersion, filepath)) .addTask(new OptiFineInstaller(p, v.selfVersion, filepath))
.start(); .start();
} }
} }
}; };
@@ -93,8 +93,8 @@ public final class InstallerService {
File filepath = IOUtils.tryGetCanonicalFile(IOUtils.currentDirWithSeparator() + "liteloader-universal.jar"); File filepath = IOUtils.tryGetCanonicalFile(IOUtils.currentDirWithSeparator() + "liteloader-universal.jar");
FileDownloadTask task = (FileDownloadTask) new FileDownloadTask(v.universal, filepath).setTag("LiteLoader"); FileDownloadTask task = (FileDownloadTask) new FileDownloadTask(v.universal, filepath).setTag("LiteLoader");
TaskWindow.getInstance() TaskWindow.getInstance()
.addTask(task).addTask(new LiteLoaderInstaller(p, (LiteLoaderVersionList.LiteLoaderInstallerVersion) v).registerPreviousResult(task)) .addTask(task).addTask(new LiteLoaderInstaller(p, (LiteLoaderVersionList.LiteLoaderInstallerVersion) v).registerPreviousResult(task))
.start(); .start();
} }
}; };
} }

View File

@@ -1,7 +1,7 @@
/* /*
* Hello Minecraft! Launcher. * Hello Minecraft! Launcher.
* Copyright (C) 2013 huangyuhui <huanghongxun2008@126.com> * Copyright (C) 2013 huangyuhui <huanghongxun2008@126.com>
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or * the Free Software Foundation, either version 3 of the License, or
@@ -23,14 +23,13 @@ package org.jackhuang.hellominecraft.launcher.utils.installers;
*/ */
public enum InstallerType { public enum InstallerType {
Forge("forge"), Optifine("optifine"), LiteLoader("liteloader"); Forge("forge"), Optifine("optifine"), LiteLoader("liteloader");
public final String id; public final String id;
private InstallerType(String id) { private InstallerType(String id) {
this.id = id; this.id = id;
} }
public String getLocalizedName() { public String getLocalizedName() {
return this.name(); return this.name();
} }

View File

@@ -48,6 +48,7 @@ public abstract class InstallerVersionList implements Consumer<String[]> {
* Get installers you want. * Get installers you want.
* *
* @param mcVersion the installers to this Minecraft version. * @param mcVersion the installers to this Minecraft version.
*
* @return cached result. * @return cached result.
*/ */
protected abstract List<InstallerVersion> getVersionsImpl(String mcVersion); protected abstract List<InstallerVersion> getVersionsImpl(String mcVersion);
@@ -56,8 +57,9 @@ public abstract class InstallerVersionList implements Consumer<String[]> {
* Get installers you want, please cache this method's result to save time. * Get installers you want, please cache this method's result to save time.
* *
* @param mcVersion the installers to this Minecraft version. * @param mcVersion the installers to this Minecraft version.
*
* @return a copy of the cached data to prevent * @return a copy of the cached data to prevent
* ConcurrentModificationException. * ConcurrentModificationException.
*/ */
public List<InstallerVersion> getVersions(String mcVersion) { public List<InstallerVersion> getVersions(String mcVersion) {
List<InstallerVersion> a = getVersionsImpl(mcVersion); List<InstallerVersion> a = getVersionsImpl(mcVersion);

View File

@@ -1,7 +1,7 @@
/* /*
* Hello Minecraft! Launcher. * Hello Minecraft! Launcher.
* Copyright (C) 2013 huangyuhui <huanghongxun2008@126.com> * Copyright (C) 2013 huangyuhui <huanghongxun2008@126.com>
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or * the Free Software Foundation, either version 3 of the License, or

View File

@@ -1,7 +1,7 @@
/* /*
* Hello Minecraft! Launcher. * Hello Minecraft! Launcher.
* Copyright (C) 2013 huangyuhui <huanghongxun2008@126.com> * Copyright (C) 2013 huangyuhui <huanghongxun2008@126.com>
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or * the Free Software Foundation, either version 3 of the License, or

View File

@@ -1,7 +1,7 @@
/* /*
* Hello Minecraft! Launcher. * Hello Minecraft! Launcher.
* Copyright (C) 2013 huangyuhui <huanghongxun2008@126.com> * Copyright (C) 2013 huangyuhui <huanghongxun2008@126.com>
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or * the Free Software Foundation, either version 3 of the License, or
@@ -76,9 +76,11 @@ public class ForgeInstaller extends Task {
FileUtils.copyFile(new File(from, profile.install.minecraft + ".jar"), FileUtils.copyFile(new File(from, profile.install.minecraft + ".jar"),
new File(to, profile.install.target + ".jar")); new File(to, profile.install.target + ".jar"));
HMCLog.log("Creating new version profile..." + profile.install.target + ".json"); HMCLog.log("Creating new version profile..." + profile.install.target + ".json");
/*for (MinecraftLibrary library : profile.versionInfo.libraries) /*
if (library.name.startsWith("net.minecraftforge:forge:")) * for (MinecraftLibrary library : profile.versionInfo.libraries)
library.url = installerVersion.universal;*/ * if (library.name.startsWith("net.minecraftforge:forge:"))
* library.url = installerVersion.universal;
*/
FileUtils.write(new File(to, profile.install.target + ".json"), C.gsonPrettyPrinting.toJson(profile.versionInfo)); FileUtils.write(new File(to, profile.install.target + ".json"), C.gsonPrettyPrinting.toJson(profile.versionInfo));
HMCLog.log("Extracting universal forge pack..." + profile.install.filePath); HMCLog.log("Extracting universal forge pack..." + profile.install.filePath);

View File

@@ -1,7 +1,7 @@
/* /*
* Hello Minecraft! Launcher. * Hello Minecraft! Launcher.
* Copyright (C) 2013 huangyuhui <huanghongxun2008@126.com> * Copyright (C) 2013 huangyuhui <huanghongxun2008@126.com>
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or * the Free Software Foundation, either version 3 of the License, or

View File

@@ -1,7 +1,7 @@
/* /*
* Hello Minecraft! Launcher. * Hello Minecraft! Launcher.
* Copyright (C) 2013 huangyuhui <huanghongxun2008@126.com> * Copyright (C) 2013 huangyuhui <huanghongxun2008@126.com>
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or * the Free Software Foundation, either version 3 of the License, or

View File

@@ -1,7 +1,7 @@
/* /*
* Hello Minecraft! Launcher. * Hello Minecraft! Launcher.
* Copyright (C) 2013 huangyuhui <huanghongxun2008@126.com> * Copyright (C) 2013 huangyuhui <huanghongxun2008@126.com>
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or * the Free Software Foundation, either version 3 of the License, or

View File

@@ -72,15 +72,15 @@ public class MinecraftForgeVersionList extends InstallerVersionList {
String filename = root.artifact + "-" + ver + "-" + f[1] + "." + f[0]; String filename = root.artifact + "-" + ver + "-" + f[1] + "." + f[0];
String url = Settings.getInstance().getDownloadSource().getProvider().getParsedLibraryDownloadURL(root.webpath + ver + "/" + filename); String url = Settings.getInstance().getDownloadSource().getProvider().getParsedLibraryDownloadURL(root.webpath + ver + "/" + filename);
switch (f[1]) { switch (f[1]) {
case "installer": case "installer":
iv.installer = url; iv.installer = url;
break; break;
case "universal": case "universal":
iv.universal = url; iv.universal = url;
break; break;
case "changelog": case "changelog":
iv.changelog = url; iv.changelog = url;
break; break;
} }
} }
if (StrUtils.isBlank(iv.installer) || StrUtils.isBlank(iv.universal)) if (StrUtils.isBlank(iv.installer) || StrUtils.isBlank(iv.universal))

View File

@@ -1,7 +1,7 @@
/* /*
* Hello Minecraft! Launcher. * Hello Minecraft! Launcher.
* Copyright (C) 2013 huangyuhui <huanghongxun2008@126.com> * Copyright (C) 2013 huangyuhui <huanghongxun2008@126.com>
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or * the Free Software Foundation, either version 3 of the License, or

View File

@@ -1,7 +1,7 @@
/* /*
* Hello Minecraft! Launcher. * Hello Minecraft! Launcher.
* Copyright (C) 2013 huangyuhui <huanghongxun2008@126.com> * Copyright (C) 2013 huangyuhui <huanghongxun2008@126.com>
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or * the Free Software Foundation, either version 3 of the License, or

View File

@@ -1,7 +1,7 @@
/* /*
* Hello Minecraft! Launcher. * Hello Minecraft! Launcher.
* Copyright (C) 2013 huangyuhui <huanghongxun2008@126.com> * Copyright (C) 2013 huangyuhui <huanghongxun2008@126.com>
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or * the Free Software Foundation, either version 3 of the License, or

View File

@@ -1,7 +1,7 @@
/* /*
* Hello Minecraft! Launcher. * Hello Minecraft! Launcher.
* Copyright (C) 2013 huangyuhui <huanghongxun2008@126.com> * Copyright (C) 2013 huangyuhui <huanghongxun2008@126.com>
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or * the Free Software Foundation, either version 3 of the License, or

View File

@@ -1,7 +1,7 @@
/* /*
* Hello Minecraft! Launcher. * Hello Minecraft! Launcher.
* Copyright (C) 2013 huangyuhui <huanghongxun2008@126.com> * Copyright (C) 2013 huangyuhui <huanghongxun2008@126.com>
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or * the Free Software Foundation, either version 3 of the License, or

View File

@@ -1,7 +1,7 @@
/* /*
* Hello Minecraft! Launcher. * Hello Minecraft! Launcher.
* Copyright (C) 2013 huangyuhui <huanghongxun2008@126.com> * Copyright (C) 2013 huangyuhui <huanghongxun2008@126.com>
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or * the Free Software Foundation, either version 3 of the License, or

View File

@@ -1,7 +1,7 @@
/* /*
* Hello Minecraft! Launcher. * Hello Minecraft! Launcher.
* Copyright (C) 2013 huangyuhui <huanghongxun2008@126.com> * Copyright (C) 2013 huangyuhui <huanghongxun2008@126.com>
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or * the Free Software Foundation, either version 3 of the License, or

View File

@@ -1,7 +1,7 @@
/* /*
* Hello Minecraft! Launcher. * Hello Minecraft! Launcher.
* Copyright (C) 2013 huangyuhui <huanghongxun2008@126.com> * Copyright (C) 2013 huangyuhui <huanghongxun2008@126.com>
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or * the Free Software Foundation, either version 3 of the License, or

View File

@@ -60,7 +60,7 @@ public class OptiFineBMCLVersionList extends InstallerVersionList {
if (s == null) if (s == null)
return; return;
root = C.gson.fromJson(s, new TypeToken<ArrayList<OptiFineVersion>>() { root = C.gson.fromJson(s, new TypeToken<ArrayList<OptiFineVersion>>() {
}.getType()); }.getType());
for (OptiFineVersion v : root) { for (OptiFineVersion v : root) {
v.mirror = v.mirror.replace("http://optifine.net/http://optifine.net/", "http://optifine.net/"); v.mirror = v.mirror.replace("http://optifine.net/http://optifine.net/", "http://optifine.net/");

View File

@@ -1,7 +1,7 @@
/* /*
* Hello Minecraft! Launcher. * Hello Minecraft! Launcher.
* Copyright (C) 2013 huangyuhui <huanghongxun2008@126.com> * Copyright (C) 2013 huangyuhui <huanghongxun2008@126.com>
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or * the Free Software Foundation, either version 3 of the License, or

View File

@@ -74,9 +74,9 @@ public class AppDataUpgrader extends IUpgrader {
if (mainClass != null) { if (mainClass != null) {
ArrayList<String> al = new ArrayList<>(Arrays.asList(args)); ArrayList<String> al = new ArrayList<>(Arrays.asList(args));
al.add("notfound"); al.add("notfound");
new URLClassLoader(new URL[] {jar.toURI().toURL()}, new URLClassLoader(new URL[] { jar.toURI().toURL() },
URLClassLoader.getSystemClassLoader().getParent()).loadClass(mainClass) URLClassLoader.getSystemClassLoader().getParent()).loadClass(mainClass)
.getMethod("main", String[].class).invoke(null, new Object[] {al.toArray(new String[0])}); .getMethod("main", String[].class).invoke(null, new Object[] { al.toArray(new String[0]) });
return true; return true;
} }
} }
@@ -95,7 +95,7 @@ public class AppDataUpgrader extends IUpgrader {
if (map != null && map.containsKey("pack")) if (map != null && map.containsKey("pack"))
try { try {
if (TaskWindow.getInstance().addTask(new AppDataUpgraderTask(map.get("pack"), number.version)).start()) { if (TaskWindow.getInstance().addTask(new AppDataUpgraderTask(map.get("pack"), number.version)).start()) {
new ProcessBuilder(new String[] {IOUtils.getJavaDir(), "-jar", AppDataUpgraderTask.getSelf(number.version).getAbsolutePath()}).directory(new File(".")).start(); new ProcessBuilder(new String[] { IOUtils.getJavaDir(), "-jar", AppDataUpgraderTask.getSelf(number.version).getAbsolutePath() }).directory(new File(".")).start();
System.exit(0); System.exit(0);
} }
} catch (IOException ex) { } catch (IOException ex) {

View File

@@ -1,7 +1,7 @@
/* /*
* Hello Minecraft! Launcher. * Hello Minecraft! Launcher.
* Copyright (C) 2013 huangyuhui <huanghongxun2008@126.com> * Copyright (C) 2013 huangyuhui <huanghongxun2008@126.com>
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or * the Free Software Foundation, either version 3 of the License, or
@@ -27,7 +27,7 @@ import org.jackhuang.hellominecraft.utils.VersionNumber;
* @author huangyuhui * @author huangyuhui
*/ */
public abstract class IUpgrader implements Event<VersionNumber> { public abstract class IUpgrader implements Event<VersionNumber> {
public static final IUpgrader NOW_UPGRADER = new AppDataUpgrader(); public static final IUpgrader NOW_UPGRADER = new AppDataUpgrader();
/** /**
@@ -35,6 +35,7 @@ public abstract class IUpgrader implements Event<VersionNumber> {
* *
* @param nowVersion now launcher version * @param nowVersion now launcher version
* @param args Application CommandLine Arguments * @param args Application CommandLine Arguments
*
* @return true if it is needed to break the main thread to shutdown this * @return true if it is needed to break the main thread to shutdown this
* application. * application.
*/ */
@@ -45,6 +46,7 @@ public abstract class IUpgrader implements Event<VersionNumber> {
* *
* @param sender Should be VersionChecker * @param sender Should be VersionChecker
* @param number the newest version * @param number the newest version
*
* @return should return true * @return should return true
*/ */
@Override @Override

View File

@@ -1,7 +1,7 @@
/* /*
* Hello Minecraft! Launcher. * Hello Minecraft! Launcher.
* Copyright (C) 2013 huangyuhui <huanghongxun2008@126.com> * Copyright (C) 2013 huangyuhui <huanghongxun2008@126.com>
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or * the Free Software Foundation, either version 3 of the License, or
@@ -52,7 +52,7 @@ public class NewFileUpgrader extends IUpgrader {
File newf = new File(FileUtils.getName(str)); File newf = new File(FileUtils.getName(str));
if (TaskWindow.getInstance().addTask(new FileDownloadTask(str, newf)).start()) { if (TaskWindow.getInstance().addTask(new FileDownloadTask(str, newf)).start()) {
try { try {
new ProcessBuilder(new String[] {IOUtils.tryGetCanonicalFilePath(newf), "--removeOldLauncher", IOUtils.getRealPath()}).directory(new File(".")).start(); new ProcessBuilder(new String[] { IOUtils.tryGetCanonicalFilePath(newf), "--removeOldLauncher", IOUtils.getRealPath() }).directory(new File(".")).start();
} catch (IOException ex) { } catch (IOException ex) {
HMCLog.err("Failed to start new app", ex); HMCLog.err("Failed to start new app", ex);
} }

View File

@@ -1,7 +1,7 @@
/* /*
* Hello Minecraft! Launcher. * Hello Minecraft! Launcher.
* Copyright (C) 2013 huangyuhui <huanghongxun2008@126.com> * Copyright (C) 2013 huangyuhui <huanghongxun2008@126.com>
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or * the Free Software Foundation, either version 3 of the License, or

View File

@@ -1,7 +1,7 @@
/* /*
* Hello Minecraft! Launcher. * Hello Minecraft! Launcher.
* Copyright (C) 2013 huangyuhui <huanghongxun2008@126.com> * Copyright (C) 2013 huangyuhui <huanghongxun2008@126.com>
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or * the Free Software Foundation, either version 3 of the License, or

View File

@@ -1,7 +1,7 @@
/* /*
* Hello Minecraft! Launcher. * Hello Minecraft! Launcher.
* Copyright (C) 2013 huangyuhui <huanghongxun2008@126.com> * Copyright (C) 2013 huangyuhui <huanghongxun2008@126.com>
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or * the Free Software Foundation, either version 3 of the License, or

View File

@@ -1,7 +1,7 @@
/* /*
* Hello Minecraft! Launcher. * Hello Minecraft! Launcher.
* Copyright (C) 2013 huangyuhui <huanghongxun2008@126.com> * Copyright (C) 2013 huangyuhui <huanghongxun2008@126.com>
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or * the Free Software Foundation, either version 3 of the License, or

View File

@@ -1,7 +1,7 @@
/* /*
* Hello Minecraft! Launcher. * Hello Minecraft! Launcher.
* Copyright (C) 2013 huangyuhui <huanghongxun2008@126.com> * Copyright (C) 2013 huangyuhui <huanghongxun2008@126.com>
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or * the Free Software Foundation, either version 3 of the License, or

View File

@@ -1,7 +1,7 @@
/* /*
* Hello Minecraft! Launcher. * Hello Minecraft! Launcher.
* Copyright (C) 2013 huangyuhui <huanghongxun2008@126.com> * Copyright (C) 2013 huangyuhui <huanghongxun2008@126.com>
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or * the Free Software Foundation, either version 3 of the License, or
@@ -40,6 +40,7 @@ import rx.Observable;
* @author huangyuhui * @author huangyuhui
*/ */
public class MinecraftDownloadService extends IMinecraftDownloadService { public class MinecraftDownloadService extends IMinecraftDownloadService {
MinecraftVersionManager mgr; MinecraftVersionManager mgr;
public MinecraftDownloadService(Profile p, MinecraftVersionManager mgr) { public MinecraftDownloadService(Profile p, MinecraftVersionManager mgr) {

View File

@@ -1,7 +1,7 @@
/* /*
* Hello Minecraft! Launcher. * Hello Minecraft! Launcher.
* Copyright (C) 2013 huangyuhui <huanghongxun2008@126.com> * Copyright (C) 2013 huangyuhui <huanghongxun2008@126.com>
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or * the Free Software Foundation, either version 3 of the License, or

View File

@@ -1,7 +1,7 @@
/* /*
* Hello Minecraft! Launcher. * Hello Minecraft! Launcher.
* Copyright (C) 2013 huangyuhui <huanghongxun2008@126.com> * Copyright (C) 2013 huangyuhui <huanghongxun2008@126.com>
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or * the Free Software Foundation, either version 3 of the License, or

View File

@@ -1,7 +1,7 @@
/* /*
* Hello Minecraft! Launcher. * Hello Minecraft! Launcher.
* Copyright (C) 2013 huangyuhui <huanghongxun2008@126.com> * Copyright (C) 2013 huangyuhui <huanghongxun2008@126.com>
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or * the Free Software Foundation, either version 3 of the License, or
@@ -33,7 +33,7 @@ import org.jackhuang.hellominecraft.utils.ArrayUtils;
public class MinecraftVersion implements Cloneable, Comparable<MinecraftVersion> { public class MinecraftVersion implements Cloneable, Comparable<MinecraftVersion> {
public String minecraftArguments, mainClass, time, id, type, processArguments, public String minecraftArguments, mainClass, time, id, type, processArguments,
releaseTime, assets, jar, inheritsFrom; releaseTime, assets, jar, inheritsFrom;
public int minimumLauncherVersion; public int minimumLauncherVersion;
public boolean hidden; public boolean hidden;
@@ -88,13 +88,13 @@ public class MinecraftVersion implements Cloneable, Comparable<MinecraftVersion>
} }
parent = parent.resolve(manager, resolvedSoFar); parent = parent.resolve(manager, resolvedSoFar);
MinecraftVersion result = new MinecraftVersion( MinecraftVersion result = new MinecraftVersion(
this.minecraftArguments != null ? this.minecraftArguments : parent.minecraftArguments, this.minecraftArguments != null ? this.minecraftArguments : parent.minecraftArguments,
this.mainClass != null ? this.mainClass : parent.mainClass, this.mainClass != null ? this.mainClass : parent.mainClass,
this.time, this.id, this.type, parent.processArguments, this.releaseTime, this.time, this.id, this.type, parent.processArguments, this.releaseTime,
this.assets != null ? this.assets : parent.assets, this.assets != null ? this.assets : parent.assets,
this.jar != null ? this.jar : parent.jar, this.jar != null ? this.jar : parent.jar,
null, parent.minimumLauncherVersion, null, parent.minimumLauncherVersion,
this.libraries != null ? ArrayUtils.merge(this.libraries, parent.libraries) : parent.libraries, this.hidden); this.libraries != null ? ArrayUtils.merge(this.libraries, parent.libraries) : parent.libraries, this.hidden);
return result; return result;
} }

View File

@@ -273,10 +273,10 @@ public class MinecraftVersionManager extends IMinecraftProvider {
for (MinecraftVersion s : getVersions()) { for (MinecraftVersion s : getVersions()) {
FileUtils.deleteDirectoryQuietly(new File(profile.getGameDirFile(), "versions" + File.separator + s.id + File.separator + s.id + "-natives")); FileUtils.deleteDirectoryQuietly(new File(profile.getGameDirFile(), "versions" + File.separator + s.id + File.separator + s.id + "-natives"));
File f = getRunDirectory(s.id); File f = getRunDirectory(s.id);
String[] dir = {"logs", "asm", "NVIDIA", "crash-reports", "server-resource-packs", "natives", "native"}; String[] dir = { "logs", "asm", "NVIDIA", "crash-reports", "server-resource-packs", "natives", "native" };
for (String str : dir) for (String str : dir)
FileUtils.deleteDirectoryQuietly(new File(f, str)); FileUtils.deleteDirectoryQuietly(new File(f, str));
String[] files = {"output-client.log", "usercache.json", "usernamecache.json", "hmclmc.log"}; String[] files = { "output-client.log", "usercache.json", "usernamecache.json", "hmclmc.log" };
for (String str : files) for (String str : files)
new File(f, str).delete(); new File(f, str).delete();
} }

View File

@@ -1,7 +1,7 @@
/* /*
* Hello Minecraft! Launcher. * Hello Minecraft! Launcher.
* Copyright (C) 2013 huangyuhui <huanghongxun2008@126.com> * Copyright (C) 2013 huangyuhui <huanghongxun2008@126.com>
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or * the Free Software Foundation, either version 3 of the License, or

View File

@@ -1,7 +1,7 @@
/* /*
* Hello Minecraft! Launcher. * Hello Minecraft! Launcher.
* Copyright (C) 2013 huangyuhui <huanghongxun2008@126.com> * Copyright (C) 2013 huangyuhui <huanghongxun2008@126.com>
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or * the Free Software Foundation, either version 3 of the License, or

View File

@@ -1,7 +1,7 @@
/* /*
* Hello Minecraft! Launcher. * Hello Minecraft! Launcher.
* Copyright (C) 2013 huangyuhui <huanghongxun2008@126.com> * Copyright (C) 2013 huangyuhui <huanghongxun2008@126.com>
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or * the Free Software Foundation, either version 3 of the License, or

View File

@@ -27,7 +27,7 @@ import javax.swing.JFrame;
* @author huangyuhui * @author huangyuhui
*/ */
public class DraggableFrame extends JFrame public class DraggableFrame extends JFrame
implements MouseListener, MouseMotionListener { implements MouseListener, MouseMotionListener {
private int dragGripX; private int dragGripX;
private int dragGripY; private int dragGripY;

View File

@@ -42,10 +42,9 @@ public class GameDownloadPanel extends AnimatedPanel implements Selectable {
} }
/** /**
* This method is called from within the constructor to * This method is called from within the constructor to initialize the form.
* initialize the form. * WARNING: Do NOT modify this code. The content of this method is always
* WARNING: Do NOT modify this code. The content of this method is * regenerated by the Form Editor.
* always regenerated by the Form Editor.
*/ */
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
@@ -110,8 +109,8 @@ public class GameDownloadPanel extends AnimatedPanel implements Selectable {
DefaultTableModel model = SwingUtils.clearDefaultTable(lstDownloads); DefaultTableModel model = SwingUtils.clearDefaultTable(lstDownloads);
gsp.getProfile().getMinecraftProvider().getDownloadService().getRemoteVersions() gsp.getProfile().getMinecraftProvider().getDownloadService().getRemoteVersions()
.observeOn(Schedulers.eventQueue()).subscribeOn(Schedulers.newThread()) .observeOn(Schedulers.eventQueue()).subscribeOn(Schedulers.newThread())
.subscribe((ver) -> model.addRow(new Object[] {ver.id, ver.time, .subscribe((ver) -> model.addRow(new Object[] { ver.id, ver.time,
StrUtils.equalsOne(ver.type, "old_beta", "old_alpha", "release", "snapshot") ? C.i18n("versions." + ver.type) : ver.type}), StrUtils.equalsOne(ver.type, "old_beta", "old_alpha", "release", "snapshot") ? C.i18n("versions." + ver.type) : ver.type }),
(e) -> { (e) -> {
MessageBox.Show("Failed to refresh download: " + e.getLocalizedMessage()); MessageBox.Show("Failed to refresh download: " + e.getLocalizedMessage());
HMCLog.err("Failed to refresh download.", e); HMCLog.err("Failed to refresh download.", e);

View File

@@ -1247,13 +1247,13 @@ public final class GameSettingsPanel extends AnimatedPanel implements DropTarget
reloadingMods = true; reloadingMods = true;
DefaultTableModel model = SwingUtils.clearDefaultTable(lstExternalMods); DefaultTableModel model = SwingUtils.clearDefaultTable(lstExternalMods);
Observable.<List<ModInfo>>createWithEmptySubscription( Observable.<List<ModInfo>>createWithEmptySubscription(
t -> t.onNext(getProfile().getMinecraftProvider().getModService().recacheMods())) t -> t.onNext(getProfile().getMinecraftProvider().getModService().recacheMods()))
.subscribeOn(Schedulers.newThread()).observeOn(Schedulers.eventQueue()) .subscribeOn(Schedulers.newThread()).observeOn(Schedulers.eventQueue())
.subscribe(t -> { .subscribe(t -> {
for (ModInfo x : t) for (ModInfo x : t)
model.addRow(new Object[]{x.isActive(), x, x.version}); model.addRow(new Object[] { x.isActive(), x, x.version });
reloadingMods = false; reloadingMods = false;
}); });
} }
// </editor-fold> // </editor-fold>

View File

@@ -1,7 +1,7 @@
/* /*
* Hello Minecraft! Launcher. * Hello Minecraft! Launcher.
* Copyright (C) 2013 huangyuhui <huanghongxun2008@126.com> * Copyright (C) 2013 huangyuhui <huanghongxun2008@126.com>
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or * the Free Software Foundation, either version 3 of the License, or
@@ -30,7 +30,7 @@ import javax.swing.JLabel;
* @author huangyuhui * @author huangyuhui
*/ */
public class HeaderTab extends JLabel public class HeaderTab extends JLabel
implements MouseListener { implements MouseListener {
private boolean isActive; private boolean isActive;
private final DefaultButtonModel model; private final DefaultButtonModel model;

View File

@@ -43,7 +43,7 @@ public class InstallerPanel extends AnimatedPanel implements Selectable {
/** /**
* Creates new form InstallerPanel * Creates new form InstallerPanel
* *
* @param gsp To get the minecraft version * @param gsp To get the minecraft version
* @param installerType load which installer * @param installerType load which installer
*/ */
public InstallerPanel(GameSettingsPanel gsp, InstallerType installerType) { public InstallerPanel(GameSettingsPanel gsp, InstallerType installerType) {
@@ -124,7 +124,7 @@ public class InstallerPanel extends AnimatedPanel implements Selectable {
void refreshVersions() { void refreshVersions() {
if (TaskWindow.getInstance().addTask(new TaskRunnableArg1<>(C.i18n("install." + id.id + ".get_list"), list) if (TaskWindow.getInstance().addTask(new TaskRunnableArg1<>(C.i18n("install." + id.id + ".get_list"), list)
.registerPreviousResult(new DefaultPreviousResult<>(new String[]{gsp.getMinecraftVersionFormatted()}))) .registerPreviousResult(new DefaultPreviousResult<>(new String[] { gsp.getMinecraftVersionFormatted() })))
.start()) .start())
loadVersions(); loadVersions();
} }
@@ -152,7 +152,7 @@ public class InstallerPanel extends AnimatedPanel implements Selectable {
if (versions != null) if (versions != null)
for (InstallerVersionList.InstallerVersion v : versions) for (InstallerVersionList.InstallerVersion v : versions)
if (v != null) if (v != null)
model.addRow(new Object[]{v.selfVersion == null ? "null" : v.selfVersion, v.mcVersion == null ? "null" : v.mcVersion}); model.addRow(new Object[] { v.selfVersion == null ? "null" : v.selfVersion, v.mcVersion == null ? "null" : v.mcVersion });
} }
}); });
} }

View File

@@ -43,7 +43,7 @@ public class LauncherSettingsPanel extends AnimatedPanel {
initComponents(); initComponents();
Observable.from(DownloadType.values()).map(t -> t.getName()).toList() Observable.from(DownloadType.values()).map(t -> t.getName()).toList()
.subscribe(t -> cboDownloadSource.setModel(new DefaultComboBoxModel(t.toArray(new String[0])))); .subscribe(t -> cboDownloadSource.setModel(new DefaultComboBoxModel(t.toArray(new String[0]))));
txtBackgroundPath.setText(Settings.getInstance().getBgpath()); txtBackgroundPath.setText(Settings.getInstance().getBgpath());
txtProxyHost.setText(Settings.getInstance().getProxyHost()); txtProxyHost.setText(Settings.getInstance().getProxyHost());

View File

@@ -438,7 +438,7 @@ public final class MainFrame extends DraggableFrame {
int contentWidth = width - off - off; int contentWidth = width - off - off;
int contentHeight = height - off - off; int contentHeight = height - off - off;
BufferedImage contentImage = new BufferedImage(contentWidth, BufferedImage contentImage = new BufferedImage(contentWidth,
contentHeight, Transparency.OPAQUE); contentHeight, Transparency.OPAQUE);
Graphics2D contentG2d = contentImage.createGraphics(); Graphics2D contentG2d = contentImage.createGraphics();
contentG2d.translate(-off, -off); contentG2d.translate(-off, -off);
paintImpl(g); paintImpl(g);

View File

@@ -39,10 +39,9 @@ public class ServerListCellRenderer extends javax.swing.JPanel implements ListCe
} }
/** /**
* This method is called from within the constructor to * This method is called from within the constructor to initialize the form.
* initialize the form. * WARNING: Do NOT modify this code. The content of this method is always
* WARNING: Do NOT modify this code. The content of this method is * regenerated by the Form Editor.
* always regenerated by the Form Editor.
*/ */
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents

View File

@@ -57,10 +57,9 @@ public class ServerListView extends javax.swing.JDialog {
public static final int FAILED_TO_SELECT = -1; public static final int FAILED_TO_SELECT = -1;
/** /**
* This method is called from within the constructor to * This method is called from within the constructor to initialize the form.
* initialize the form. * WARNING: Do NOT modify this code. The content of this method is always
* WARNING: Do NOT modify this code. The content of this method is * regenerated by the Form Editor.
* always regenerated by the Form Editor.
*/ */
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents

View File

@@ -1,7 +1,7 @@
/* /*
* Hello Minecraft! Launcher. * Hello Minecraft! Launcher.
* Copyright (C) 2013 huangyuhui <huanghongxun2008@126.com> * Copyright (C) 2013 huangyuhui <huanghongxun2008@126.com>
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or * the Free Software Foundation, either version 3 of the License, or

View File

@@ -1,7 +1,7 @@
/* /*
* Hello Minecraft! Launcher. * Hello Minecraft! Launcher.
* Copyright (C) 2013 huangyuhui <huanghongxun2008@126.com> * Copyright (C) 2013 huangyuhui <huanghongxun2008@126.com>
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or * the Free Software Foundation, either version 3 of the License, or

View File

@@ -1,7 +1,7 @@
/* /*
* Hello Minecraft! Launcher. * Hello Minecraft! Launcher.
* Copyright (C) 2013 huangyuhui <huanghongxun2008@126.com> * Copyright (C) 2013 huangyuhui <huanghongxun2008@126.com>
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or * the Free Software Foundation, either version 3 of the License, or

View File

@@ -1,7 +1,7 @@
/* /*
* Hello Minecraft! Launcher. * Hello Minecraft! Launcher.
* Copyright (C) 2013 huangyuhui <huanghongxun2008@126.com> * Copyright (C) 2013 huangyuhui <huanghongxun2008@126.com>
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or * the Free Software Foundation, either version 3 of the License, or

View File

@@ -1,7 +1,7 @@
/* /*
* Hello Minecraft! Launcher. * Hello Minecraft! Launcher.
* Copyright (C) 2013 huangyuhui <huanghongxun2008@126.com> * Copyright (C) 2013 huangyuhui <huanghongxun2008@126.com>
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or * the Free Software Foundation, either version 3 of the License, or

View File

@@ -1,7 +1,7 @@
/* /*
* Hello Minecraft! Launcher. * Hello Minecraft! Launcher.
* Copyright (C) 2013 huangyuhui <huanghongxun2008@126.com> * Copyright (C) 2013 huangyuhui <huanghongxun2008@126.com>
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or * the Free Software Foundation, either version 3 of the License, or

View File

@@ -1,7 +1,7 @@
/* /*
* Hello Minecraft! Launcher. * Hello Minecraft! Launcher.
* Copyright (C) 2013 huangyuhui <huanghongxun2008@126.com> * Copyright (C) 2013 huangyuhui <huanghongxun2008@126.com>
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or * the Free Software Foundation, either version 3 of the License, or

View File

@@ -1,7 +1,7 @@
/* /*
* Hello Minecraft! Launcher. * Hello Minecraft! Launcher.
* Copyright (C) 2013 huangyuhui <huanghongxun2008@126.com> * Copyright (C) 2013 huangyuhui <huanghongxun2008@126.com>
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or * the Free Software Foundation, either version 3 of the License, or
@@ -50,7 +50,7 @@ public class ConsoleAppender extends OutputStreamAppender {
@Override @Override
public void write(byte[] b, int off, int len) public void write(byte[] b, int off, int len)
throws IOException { throws IOException {
System.out.write(b, off, len); System.out.write(b, off, len);
} }
@@ -78,7 +78,7 @@ public class ConsoleAppender extends OutputStreamAppender {
@Override @Override
public void write(byte[] b, int off, int len) public void write(byte[] b, int off, int len)
throws IOException { throws IOException {
System.err.write(b, off, len); System.err.write(b, off, len);
} }

View File

@@ -1,7 +1,7 @@
/* /*
* Hello Minecraft! Launcher. * Hello Minecraft! Launcher.
* Copyright (C) 2013 huangyuhui <huanghongxun2008@126.com> * Copyright (C) 2013 huangyuhui <huanghongxun2008@126.com>
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or * the Free Software Foundation, either version 3 of the License, or

View File

@@ -1,7 +1,7 @@
/* /*
* Hello Minecraft! Launcher. * Hello Minecraft! Launcher.
* Copyright (C) 2013 huangyuhui <huanghongxun2008@126.com> * Copyright (C) 2013 huangyuhui <huanghongxun2008@126.com>
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or * the Free Software Foundation, either version 3 of the License, or

View File

@@ -1,7 +1,7 @@
/* /*
* Hello Minecraft! Launcher. * Hello Minecraft! Launcher.
* Copyright (C) 2013 huangyuhui <huanghongxun2008@126.com> * Copyright (C) 2013 huangyuhui <huanghongxun2008@126.com>
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or * the Free Software Foundation, either version 3 of the License, or

View File

@@ -1,7 +1,7 @@
/* /*
* Hello Minecraft! Launcher. * Hello Minecraft! Launcher.
* Copyright (C) 2013 huangyuhui <huanghongxun2008@126.com> * Copyright (C) 2013 huangyuhui <huanghongxun2008@126.com>
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or * the Free Software Foundation, either version 3 of the License, or

View File

@@ -1,7 +1,7 @@
/* /*
* Hello Minecraft! Launcher. * Hello Minecraft! Launcher.
* Copyright (C) 2013 huangyuhui <huanghongxun2008@126.com> * Copyright (C) 2013 huangyuhui <huanghongxun2008@126.com>
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or * the Free Software Foundation, either version 3 of the License, or

View File

@@ -1,7 +1,7 @@
/* /*
* Hello Minecraft! Launcher. * Hello Minecraft! Launcher.
* Copyright (C) 2013 huangyuhui <huanghongxun2008@126.com> * Copyright (C) 2013 huangyuhui <huanghongxun2008@126.com>
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or * the Free Software Foundation, either version 3 of the License, or
@@ -22,7 +22,7 @@ package org.jackhuang.hellominecraft.logging.message;
* @author huangyuhui * @author huangyuhui
*/ */
public abstract class AbstractMessageFactory public abstract class AbstractMessageFactory
implements IMessageFactory { implements IMessageFactory {
@Override @Override
public IMessage newMessage(Object message) { public IMessage newMessage(Object message) {

View File

@@ -1,7 +1,7 @@
/* /*
* Hello Minecraft! Launcher. * Hello Minecraft! Launcher.
* Copyright (C) 2013 huangyuhui <huanghongxun2008@126.com> * Copyright (C) 2013 huangyuhui <huanghongxun2008@126.com>
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or * the Free Software Foundation, either version 3 of the License, or

Some files were not shown because too many files have changed in this diff Show More