reconstruct code && add advice for out of memory error.

This commit is contained in:
huanghongxun
2015-07-06 12:50:02 +08:00
parent d398de5d4e
commit 244b646225
183 changed files with 381 additions and 346 deletions

View File

@@ -38,7 +38,7 @@ import org.jackhuang.hellominecraft.utils.Utils;
/** /**
* *
* @author hyh * @author huangyuhui
*/ */
public final class Launcher { public final class Launcher {

View File

@@ -47,7 +47,7 @@ import org.jackhuang.hellominecraft.utils.StrUtils;
/** /**
* *
* @author hyh * @author huangyuhui
*/ */
public final class Main implements NonConsumer { public final class Main implements NonConsumer {

View File

@@ -0,0 +1,185 @@
/*
* Copyright 2013 huangyuhui <huanghongxun2008@126.com>
*
* 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
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program.
*/
package org.jackhuang.hellominecraft.launcher.launch;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import org.jackhuang.hellominecraft.C;
import org.jackhuang.hellominecraft.HMCLog;
import org.jackhuang.hellominecraft.launcher.Launcher;
import org.jackhuang.hellominecraft.launcher.utils.auth.UserProfileProvider;
import org.jackhuang.hellominecraft.launcher.settings.Profile;
import org.jackhuang.hellominecraft.launcher.settings.Settings;
import org.jackhuang.hellominecraft.utils.system.JdkVersion;
import org.jackhuang.hellominecraft.utils.MathUtils;
import org.jackhuang.hellominecraft.utils.system.MessageBox;
import org.jackhuang.hellominecraft.utils.system.OS;
import org.jackhuang.hellominecraft.utils.system.Platform;
import org.jackhuang.hellominecraft.utils.StrUtils;
import org.jackhuang.hellominecraft.utils.Utils;
/**
*
* @author huangyuhui
*/
public abstract class AbstractMinecraftLoader implements IMinecraftLoader {
protected File minecraftJar;
protected Profile v;
protected UserProfileProvider lr;
protected File gameDir;
protected IMinecraftProvider provider;
public AbstractMinecraftLoader(Profile ver, IMinecraftProvider provider, UserProfileProvider lr, File minecraftJar) {
this.lr = lr;
this.minecraftJar = minecraftJar;
v = ver;
this.provider = provider;
gameDir = v.getCanonicalGameDirFile();
}
public void makeHeadCommand(List<String> res) {
HMCLog.log("On making head command.");
if (StrUtils.isNotBlank(v.getWrapperLauncher()))
res.addAll(Arrays.asList(v.getWrapperLauncher().split(" ")));
String str = v.getJavaDir();
JdkVersion jv = new JdkVersion(str);
if(Settings.getInstance().getJava().contains(jv))
jv = Settings.getInstance().getJava().get(Settings.getInstance().getJava().indexOf(jv));
else try {
jv = JdkVersion.getJavaVersionFromExecutable(str);
Settings.getInstance().getJava().add(jv);
Settings.save();
} catch (IOException ex) {
HMCLog.warn("Failed to get java version", ex);
jv = null;
}
res.add(str);
if (v.hasJavaArgs())
res.addAll(Arrays.asList(StrUtils.tokenize(v.getJavaArgs())));
if (!v.isNoJVMArgs() && !(jv != null && jv.isEarlyAccess())) {
res.add("-XX:+UseConcMarkSweepGC");
res.add("-XX:+CMSIncrementalMode");
res.add("-XX:-UseAdaptiveSizePolicy");
res.add("-Xmn128m");
}
if (jv != null && jv.getPlatform() == Platform.BIT_32 && Platform.getPlatform() == Platform.BIT_64)
MessageBox.Show(C.i18n("advice.os64butjdk32"));
if (!StrUtils.isBlank(v.getMaxMemory())) {
int mem = MathUtils.parseMemory(v.getMaxMemory(), 2147483647);
if (jv != null && jv.getPlatform() == Platform.BIT_32 && mem > 1024)
MessageBox.Show(C.i18n("launch.too_big_memory_alloc_64bit"));
else {
long a = OS.getTotalPhysicalMemory() / 1024 / 1024;
HMCLog.log("System Physical Memory: " + a);
if (a > 0 && a < mem)
MessageBox.Show(C.i18n("launch.too_big_memory_alloc_free_space_too_low", a));
}
String a = "-Xmx" + v.getMaxMemory();
if (MathUtils.canParseInt(v.getMaxMemory())) a += "m";
res.add(a);
}
if (!StrUtils.isBlank(v.getPermSize()) && !v.isNoJVMArgs())
if (jv != null && jv.getParsedVersion() >= JdkVersion.JAVA_18);
else res.add("-XX:MaxPermSize=" + v.getPermSize() + "m");
if (!v.isNoJVMArgs()) appendJVMArgs(res);
HMCLog.log("On making java.library.path.");
res.add("-Djava.library.path=" + provider.getDecompressNativesToLocation().getPath());
res.add("-Dfml.ignoreInvalidMinecraftCertificates=true");
res.add("-Dfml.ignorePatchDiscrepancies=true");
if (OS.os() != OS.WINDOWS)
res.add("-Duser.home=" + gameDir.getParent());
if (!v.isCanceledWrapper()) {
res.add("-cp");
res.add(StrUtils.parseParams("", Utils.getURL(), File.pathSeparator));
res.add(Launcher.class.getCanonicalName());
}
}
@Override
public List<String> makeLaunchingCommand() {
HMCLog.log("*** Make shell command ***");
ArrayList<String> res = new ArrayList<>();
makeHeadCommand(res);
makeSelf(res);
HMCLog.log("On making launcher args.");
if (StrUtils.isNotBlank(v.getHeight()) && StrUtils.isNotBlank(v.getWidth())) {
res.add("--height");
res.add(v.getHeight());
res.add("--width");
res.add(v.getWidth());
}
if (StrUtils.isNotBlank(v.getServerIp())) {
String[] args = v.getServerIp().split(":");
res.add("--server");
res.add(args[0]);
res.add("--port");
res.add(args.length > 1 ? args[1] : "25565");
}
if (v.isFullscreen())
res.add("--fullscreen");
if (v.isDebug() && !v.isCanceledWrapper())
res.add("-debug");
if (StrUtils.isNotBlank(v.getMinecraftArgs()))
res.addAll(Arrays.asList(v.getMinecraftArgs().split(" ")));
return res;
}
/**
* You must do these things:<br />
* <ul>
* <li>minecraft class path</li>
* <li>main class</li>
* <li>minecraft arguments</li>
* </ul>
* @param list the command list you shoud edit.
*/
protected abstract void makeSelf(List<String> list);
protected void appendJVMArgs(List<String> list) {
}
public Profile getUserVersion() {
return v;
}
}

View File

@@ -16,168 +16,12 @@
*/ */
package org.jackhuang.hellominecraft.launcher.launch; package org.jackhuang.hellominecraft.launcher.launch;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List; import java.util.List;
import org.jackhuang.hellominecraft.C;
import org.jackhuang.hellominecraft.HMCLog;
import org.jackhuang.hellominecraft.launcher.Launcher;
import org.jackhuang.hellominecraft.launcher.utils.auth.UserProfileProvider;
import org.jackhuang.hellominecraft.launcher.settings.Profile;
import org.jackhuang.hellominecraft.launcher.settings.Settings;
import org.jackhuang.hellominecraft.utils.system.JdkVersion;
import org.jackhuang.hellominecraft.utils.MathUtils;
import org.jackhuang.hellominecraft.utils.system.MessageBox;
import org.jackhuang.hellominecraft.utils.system.OS;
import org.jackhuang.hellominecraft.utils.system.Platform;
import org.jackhuang.hellominecraft.utils.StrUtils;
import org.jackhuang.hellominecraft.utils.Utils;
/** /**
* *
* @author hyh * @author huangyuhui
*/ */
public abstract class IMinecraftLoader { public interface IMinecraftLoader {
List<String> makeLaunchingCommand();
protected File minecraftJar;
protected Profile v;
protected UserProfileProvider lr;
protected File gameDir;
protected IMinecraftProvider provider;
public IMinecraftLoader(Profile ver, IMinecraftProvider provider, UserProfileProvider lr, File minecraftJar) {
this.lr = lr;
this.minecraftJar = minecraftJar;
v = ver;
this.provider = provider;
gameDir = v.getCanonicalGameDirFile();
}
public void makeHeadCommand(List<String> res) {
HMCLog.log("On making head command.");
if (StrUtils.isNotBlank(v.getWrapperLauncher()))
res.addAll(Arrays.asList(v.getWrapperLauncher().split(" ")));
String str = v.getJavaDir();
JdkVersion jv = new JdkVersion(str);
if(Settings.getInstance().getJava().contains(jv))
jv = Settings.getInstance().getJava().get(Settings.getInstance().getJava().indexOf(jv));
else try {
jv = JdkVersion.getJavaVersionFromExecutable(str);
Settings.getInstance().getJava().add(jv);
Settings.save();
} catch (IOException ex) {
HMCLog.warn("Failed to get java version", ex);
jv = null;
}
res.add(str);
if (v.hasJavaArgs())
res.addAll(Arrays.asList(StrUtils.tokenize(v.getJavaArgs())));
if (!v.isNoJVMArgs() && !(jv != null && jv.isEarlyAccess())) {
res.add("-XX:+UseConcMarkSweepGC");
res.add("-XX:+CMSIncrementalMode");
res.add("-XX:-UseAdaptiveSizePolicy");
res.add("-Xmn128m");
}
if (jv != null && jv.getPlatform() == Platform.BIT_32 && Platform.getPlatform() == Platform.BIT_64)
MessageBox.Show(C.i18n("advice.os64butjdk32"));
if (!StrUtils.isBlank(v.getMaxMemory())) {
int mem = MathUtils.parseMemory(v.getMaxMemory(), 2147483647);
if (jv != null && jv.getPlatform() == Platform.BIT_32 && mem > 1024)
MessageBox.Show(C.i18n("launch.too_big_memory_alloc_64bit"));
else {
long a = OS.getTotalPhysicalMemory() / 1024 / 1024;
HMCLog.log("System Physical Memory: " + a);
if (a > 0 && a < mem)
MessageBox.Show(C.i18n("launch.too_big_memory_alloc_free_space_too_low", a));
}
String a = "-Xmx" + v.getMaxMemory();
if (MathUtils.canParseInt(v.getMaxMemory())) a += "m";
res.add(a);
}
if (!StrUtils.isBlank(v.getPermSize()) && !v.isNoJVMArgs())
if (jv != null && jv.getParsedVersion() >= JdkVersion.JAVA_18);
else res.add("-XX:MaxPermSize=" + v.getPermSize() + "m");
if (!v.isNoJVMArgs()) appendJVMArgs(res);
HMCLog.log("On making java.library.path.");
res.add("-Djava.library.path=" + provider.getDecompressNativesToLocation().getPath());
res.add("-Dfml.ignoreInvalidMinecraftCertificates=true");
res.add("-Dfml.ignorePatchDiscrepancies=true");
if (OS.os() != OS.WINDOWS)
res.add("-Duser.home=" + gameDir.getParent());
if (!v.isCanceledWrapper()) {
res.add("-cp");
res.add(StrUtils.parseParams("", Utils.getURL(), File.pathSeparator));
res.add(Launcher.class.getCanonicalName());
}
}
public List<String> makeLaunchingCommand() {
HMCLog.log("*** Make shell command ***");
ArrayList<String> res = new ArrayList<>();
makeHeadCommand(res);
makeSelf(res);
HMCLog.log("On making launcher args.");
if (StrUtils.isNotBlank(v.getHeight()) && StrUtils.isNotBlank(v.getWidth())) {
res.add("--height");
res.add(v.getHeight());
res.add("--width");
res.add(v.getWidth());
}
if (StrUtils.isNotBlank(v.getServerIp())) {
String[] args = v.getServerIp().split(":");
res.add("--server");
res.add(args[0]);
res.add("--port");
res.add(args.length > 1 ? args[1] : "25565");
}
if (v.isFullscreen())
res.add("--fullscreen");
if (v.isDebug() && !v.isCanceledWrapper())
res.add("-debug");
if (StrUtils.isNotBlank(v.getMinecraftArgs()))
res.addAll(Arrays.asList(v.getMinecraftArgs().split(" ")));
return res;
}
/**
* You must do these things:<br />
* 1 minecraft class path<br />
* 2 main class<br />
* 3 minecraft arguments<br />
*
* @param list the command list you shoud edit.
*/
protected abstract void makeSelf(List<String> list);
protected void appendJVMArgs(List<String> list) {
}
public Profile getUserVersion() {
return v;
}
} }

View File

@@ -21,7 +21,7 @@ import org.jackhuang.hellominecraft.C;
/** /**
* Give the advice to solve the Minecraft crashing. * Give the advice to solve the Minecraft crashing.
* *
* @author hyh * @author huangyuhui
*/ */
public final class MinecraftCrashAdvicer { public final class MinecraftCrashAdvicer {
@@ -30,21 +30,24 @@ public final class MinecraftCrashAdvicer {
} }
public static String getAdvice(String trace, boolean selfCrash) { public static String getAdvice(String trace, boolean selfCrash) {
if(trace.contains("Pixel format not accelerated")) { trace = trace.toLowerCase();
if(trace.contains("pixel format not accelerated")) {
return C.i18n("crash.advice.LWJGLException"); return C.i18n("crash.advice.LWJGLException");
} else if (trace.contains("UnsupportedClassVersionError")) { } else if (trace.contains("unsupportedclassversionrrror")) {
return C.i18n("crash.advice.UnsupportedClassVersionError"); return C.i18n("crash.advice.UnsupportedClassVersionError");
} else if (trace.contains("ConcurrentModificationException")) { } else if (trace.contains("concurrentmodificationexception")) {
return C.i18n("crash.advice.ConcurrentModificationException"); return C.i18n("crash.advice.ConcurrentModificationException");
} else if (trace.contains("SecurityException")) { } else if (trace.contains("securityexception")) {
return C.i18n("crash.advice.SecurityException"); return C.i18n("crash.advice.SecurityException");
} else if (trace.contains("NoSuchFieldException") || trace.contains("NoSuchFieldError")) { } else if (trace.contains("nosuchfieldexception") || trace.contains("nosuchfielderror")) {
return C.i18n("crash.advice.NoSuchFieldError"); return C.i18n("crash.advice.NoSuchFieldError");
} else if (trace.contains("NoClassDefFoundError") || trace.contains("ClassNotFoundException")) { } else if (trace.contains("outofmemory") || trace.contains("out of memory")) {
return C.i18n("crash.advice.OutOfMemoryError");
} else if (trace.contains("noclassdeffounderror") || trace.contains("classnotfoundexception")) {
return C.i18n("crash.advice.ClassNotFoundException"); return C.i18n("crash.advice.ClassNotFoundException");
} else if (trace.contains("no lwjgl in java.library.path")) { } else if (trace.contains("no lwjgl in java.library.path")) {
return C.i18n("crash.advice.no_lwjgl"); return C.i18n("crash.advice.no_lwjgl");
} else if (trace.contains("OpenGL") || trace.contains("OpenAL")) { } else if (trace.contains("opengl") || trace.contains("openal")) {
return C.i18n("crash.advice.OpenGL"); return C.i18n("crash.advice.OpenGL");
} }
return C.i18n(selfCrash ? "crash.advice.no" : "crash.advice.otherwise"); return C.i18n(selfCrash ? "crash.advice.no" : "crash.advice.otherwise");

View File

@@ -37,9 +37,9 @@ import org.jackhuang.hellominecraft.utils.system.MessageBox;
/** /**
* *
* @author hyh * @author huangyuhui
*/ */
public class MinecraftLoader extends IMinecraftLoader { public class MinecraftLoader extends AbstractMinecraftLoader {
private MinecraftVersion version; private MinecraftVersion version;
String text; String text;

View File

@@ -28,7 +28,7 @@ import org.jackhuang.hellominecraft.utils.system.OS;
/** /**
* *
* @author hyh * @author huangyuhui
*/ */
public final class Config { public final class Config {
@SerializedName("last") @SerializedName("last")

View File

@@ -28,7 +28,7 @@ import org.jackhuang.hellominecraft.launcher.version.MinecraftVersionManager;
/** /**
* *
* @author hyh * @author huangyuhui
*/ */
public final class Profile { public final class Profile {

View File

@@ -35,7 +35,7 @@ import org.jackhuang.hellominecraft.utils.VersionNumber;
/** /**
* *
* @author hyh * @author huangyuhui
*/ */
public final class Settings { public final class Settings {

View File

@@ -29,7 +29,7 @@ import org.jackhuang.hellominecraft.views.LogWindow;
/** /**
* *
* @author hyh * @author huangyuhui
*/ */
public class CrashReporter implements Thread.UncaughtExceptionHandler { public class CrashReporter implements Thread.UncaughtExceptionHandler {

View File

@@ -23,7 +23,7 @@ import java.util.Set;
/** /**
* *
* @author hyh * @author huangyuhui
*/ */
public class AssetsIndex { public class AssetsIndex {

View File

@@ -33,7 +33,7 @@ import org.xml.sax.SAXException;
/** /**
* *
* @author hyh * @author huangyuhui
*/ */
public class AssetsLoader extends Thread { public class AssetsLoader extends Thread {

View File

@@ -20,7 +20,7 @@ import java.util.ArrayList;
/** /**
* *
* @author hyh * @author huangyuhui
*/ */
public interface AssetsLoaderListener { public interface AssetsLoaderListener {

View File

@@ -34,7 +34,7 @@ import org.jackhuang.hellominecraft.utils.VersionNumber;
/** /**
* *
* @author hyh * @author huangyuhui
*/ */
public class AssetsMojangLoader extends IAssetsHandler { public class AssetsMojangLoader extends IAssetsHandler {

View File

@@ -26,7 +26,7 @@ import org.jackhuang.hellominecraft.utils.functions.Consumer;
/** /**
* *
* @author hyh * @author huangyuhui
*/ */
public class AssetsMojangOldLoader extends IAssetsHandler { public class AssetsMojangOldLoader extends IAssetsHandler {

View File

@@ -18,7 +18,7 @@ package org.jackhuang.hellominecraft.launcher.utils.assets;
/** /**
* *
* @author hyh * @author huangyuhui
*/ */
public class AssetsObject { public class AssetsObject {
private String hash; private String hash;

View File

@@ -18,7 +18,7 @@ package org.jackhuang.hellominecraft.launcher.utils.assets;
/** /**
* *
* @author hyh * @author huangyuhui
*/ */
public class Contents { public class Contents {

View File

@@ -37,7 +37,7 @@ import org.jackhuang.hellominecraft.utils.NetUtils;
/** /**
* Assets * Assets
* *
* @author hyh * @author huangyuhui
*/ */
public abstract class IAssetsHandler { public abstract class IAssetsHandler {

View File

@@ -23,7 +23,7 @@ import org.jackhuang.hellominecraft.utils.code.DigestUtils;
/** /**
* *
* @author hyh * @author huangyuhui
*/ */
public final class BestLogin extends IAuthenticator { public final class BestLogin extends IAuthenticator {

View File

@@ -23,7 +23,7 @@ import org.jackhuang.hellominecraft.launcher.settings.Settings;
/** /**
* Login interface * Login interface
* *
* @author hyh * @author huangyuhui
*/ */
public abstract class IAuthenticator { public abstract class IAuthenticator {

View File

@@ -18,7 +18,7 @@ package org.jackhuang.hellominecraft.launcher.utils.auth;
/** /**
* *
* @author hyh * @author huangyuhui
*/ */
public final class LoginInfo { public final class LoginInfo {
public String username, password; public String username, password;

View File

@@ -22,7 +22,7 @@ import org.jackhuang.hellominecraft.utils.code.DigestUtils;
/** /**
* *
* @author hyh * @author huangyuhui
*/ */
public final class OfflineAuthenticator extends IAuthenticator { public final class OfflineAuthenticator extends IAuthenticator {

View File

@@ -24,7 +24,7 @@ import org.jackhuang.hellominecraft.views.Selector;
/** /**
* *
* @author hyh * @author huangyuhui
*/ */
public final class SkinmeAuthenticator extends IAuthenticator { public final class SkinmeAuthenticator extends IAuthenticator {

View File

@@ -18,7 +18,7 @@ package org.jackhuang.hellominecraft.launcher.utils.auth;
/** /**
* *
* @author hyh * @author huangyuhui
*/ */
public final class UserProfileProvider { public final class UserProfileProvider {

View File

@@ -35,7 +35,7 @@ import org.jackhuang.mojang.util.UUIDTypeAdapter;
/** /**
* *
* @author hyh * @author huangyuhui
*/ */
public final class YggdrasilAuthenticator extends IAuthenticator { public final class YggdrasilAuthenticator extends IAuthenticator {

View File

@@ -20,7 +20,7 @@ import org.jackhuang.hellominecraft.C;
/** /**
* *
* @author hyh * @author huangyuhui
*/ */
public enum DownloadType { public enum DownloadType {
Mojang(C.i18n("download.mojang"), new MojangDownloadProvider()), Mojang(C.i18n("download.mojang"), new MojangDownloadProvider()),

View File

@@ -22,7 +22,7 @@ import org.jackhuang.hellominecraft.launcher.utils.installers.forge.Install;
/** /**
* *
* @author hyh * @author huangyuhui
*/ */
public class InstallProfile { public class InstallProfile {
@SerializedName("install") @SerializedName("install")

View File

@@ -22,7 +22,7 @@ import org.jackhuang.hellominecraft.utils.functions.Consumer;
/** /**
* *
* @author hyh * @author huangyuhui
*/ */
public abstract class InstallerVersionList implements Consumer<String[]> { public abstract class InstallerVersionList implements Consumer<String[]> {
/** /**

View File

@@ -21,7 +21,7 @@ import org.jackhuang.hellominecraft.launcher.utils.installers.InstallerVersionLi
/** /**
* *
* @author hyh * @author huangyuhui
*/ */
public class InstallerVersionNewerComparator implements Comparator<InstallerVersion> { public class InstallerVersionNewerComparator implements Comparator<InstallerVersion> {

View File

@@ -25,7 +25,7 @@ import org.jackhuang.hellominecraft.utils.system.IOUtils;
/** /**
* *
* @author hyh * @author huangyuhui
*/ */
public class PackMinecraftInstaller { public class PackMinecraftInstaller {

View File

@@ -38,7 +38,7 @@ import org.jackhuang.hellominecraft.utils.system.MessageBox;
/** /**
* *
* @author hyh * @author huangyuhui
*/ */
public class ForgeInstaller extends Task { public class ForgeInstaller extends Task {

View File

@@ -23,7 +23,7 @@ import org.jackhuang.hellominecraft.launcher.utils.installers.PackMinecraftInsta
/** /**
* *
* @author hyh * @author huangyuhui
*/ */
public class ForgeOldInstaller { public class ForgeOldInstaller {

View File

@@ -18,7 +18,7 @@ package org.jackhuang.hellominecraft.launcher.utils.installers.forge;
/** /**
* *
* @author hyh * @author huangyuhui
*/ */
public class Install { public class Install {
public String profileName; public String profileName;

View File

@@ -32,7 +32,7 @@ import org.jackhuang.hellominecraft.utils.NetUtils;
/** /**
* *
* @author hyh * @author huangyuhui
*/ */
public class ForgeBMCLVersionList extends InstallerVersionList { public class ForgeBMCLVersionList extends InstallerVersionList {

View File

@@ -18,7 +18,7 @@ package org.jackhuang.hellominecraft.launcher.utils.installers.forge.bmcl;
/** /**
* *
* @author hyh * @author huangyuhui
*/ */
public class ForgeVersion { public class ForgeVersion {
public String time, minecraft, version, _id, __v; public String time, minecraft, version, _id, __v;

View File

@@ -29,7 +29,7 @@ import org.jackhuang.hellominecraft.utils.NetUtils;
/** /**
* *
* @author hyh * @author huangyuhui
*/ */
public class MinecraftForgeVersionList extends InstallerVersionList { public class MinecraftForgeVersionList extends InstallerVersionList {
private static MinecraftForgeVersionList instance; private static MinecraftForgeVersionList instance;

View File

@@ -20,7 +20,7 @@ import java.util.Map;
/** /**
* *
* @author hyh * @author huangyuhui
*/ */
public class MinecraftForgeVersionRoot { public class MinecraftForgeVersionRoot {
public String artifact, webpath, adfly, homepage, name; public String artifact, webpath, adfly, homepage, name;

View File

@@ -31,7 +31,7 @@ import org.jackhuang.hellominecraft.launcher.version.MinecraftVersion;
/** /**
* *
* @author hyh * @author huangyuhui
*/ */
public class LiteLoaderInstaller extends Task implements PreviousResultRegistrator<File> { public class LiteLoaderInstaller extends Task implements PreviousResultRegistrator<File> {

View File

@@ -32,7 +32,7 @@ import org.jackhuang.hellominecraft.utils.StrUtils;
/** /**
* *
* @author hyh * @author huangyuhui
*/ */
public class LiteLoaderVersionList extends InstallerVersionList { public class LiteLoaderVersionList extends InstallerVersionList {
private static LiteLoaderVersionList instance; private static LiteLoaderVersionList instance;

View File

@@ -20,7 +20,7 @@ import java.util.Map;
/** /**
* *
* @author hyh * @author huangyuhui
*/ */
public class LiteLoaderVersionsRoot { public class LiteLoaderVersionsRoot {
public Map<String, LiteLoaderMCVersions> versions; public Map<String, LiteLoaderMCVersions> versions;

View File

@@ -31,7 +31,7 @@ import org.jackhuang.hellominecraft.launcher.version.MinecraftVersion;
/** /**
* *
* @author hyh * @author huangyuhui
*/ */
public class OptiFineInstaller extends Task implements PreviousResultRegistrator<File> { public class OptiFineInstaller extends Task implements PreviousResultRegistrator<File> {

View File

@@ -18,7 +18,7 @@ package org.jackhuang.hellominecraft.launcher.utils.installers.optifine;
/** /**
* *
* @author hyh * @author huangyuhui
*/ */
public class OptiFineVersion { public class OptiFineVersion {
public String dl, ver, date, mirror, mcver; public String dl, ver, date, mirror, mcver;

View File

@@ -33,7 +33,7 @@ import org.jackhuang.hellominecraft.utils.StrUtils;
/** /**
* *
* @author hyh * @author huangyuhui
*/ */
public class OptiFineBMCLVersionList extends InstallerVersionList { public class OptiFineBMCLVersionList extends InstallerVersionList {

View File

@@ -25,7 +25,7 @@ import org.jackhuang.hellominecraft.utils.NetUtils;
/** /**
* *
* @author hyh * @author huangyuhui
*/ */
public class OptiFineDownloadFormatter extends Task implements PreviousResult<String> { public class OptiFineDownloadFormatter extends Task implements PreviousResult<String> {
String url, result; String url, result;

View File

@@ -41,7 +41,7 @@ import org.xml.sax.SAXException;
/** /**
* *
* @author hyh * @author huangyuhui
*/ */
public class OptiFineVersionList extends InstallerVersionList { public class OptiFineVersionList extends InstallerVersionList {
private static OptiFineVersionList instance; private static OptiFineVersionList instance;

View File

@@ -21,7 +21,7 @@ import org.jackhuang.hellominecraft.launcher.utils.download.DownloadType;
/** /**
* *
* @author hyh * @author huangyuhui
*/ */
public abstract class IMinecraftLibrary implements Cloneable { public abstract class IMinecraftLibrary implements Cloneable {

View File

@@ -24,7 +24,7 @@ import org.jackhuang.hellominecraft.launcher.utils.download.DownloadType;
/** /**
* *
* @author hyh * @author huangyuhui
*/ */
public class MinecraftClassicVersion extends MinecraftVersion { public class MinecraftClassicVersion extends MinecraftVersion {

View File

@@ -26,7 +26,7 @@ import org.jackhuang.hellominecraft.utils.StrUtils;
/** /**
* *
* @author hyh * @author huangyuhui
*/ */
public class MinecraftLibrary extends IMinecraftLibrary { public class MinecraftLibrary extends IMinecraftLibrary {

View File

@@ -21,7 +21,7 @@ import org.jackhuang.hellominecraft.launcher.utils.download.DownloadType;
/** /**
* *
* @author hyh * @author huangyuhui
*/ */
public class MinecraftOldLibrary extends MinecraftLibrary { public class MinecraftOldLibrary extends MinecraftLibrary {

View File

@@ -28,7 +28,7 @@ import org.jackhuang.hellominecraft.utils.ArrayUtils;
/** /**
* *
* @author hyh * @author huangyuhui
*/ */
public class MinecraftVersion implements Cloneable, Comparable<MinecraftVersion> { public class MinecraftVersion implements Cloneable, Comparable<MinecraftVersion> {

View File

@@ -45,7 +45,7 @@ import org.jackhuang.hellominecraft.utils.Utils;
/** /**
* *
* @author hyh * @author huangyuhui
*/ */
public final class MinecraftVersionManager extends IMinecraftProvider { public final class MinecraftVersionManager extends IMinecraftProvider {

View File

@@ -18,7 +18,7 @@ package org.jackhuang.hellominecraft.launcher.version;
/** /**
* *
* @author hyh * @author huangyuhui
*/ */
public class Natives implements Cloneable { public class Natives implements Cloneable {
public String windows, osx, linux; public String windows, osx, linux;

View File

@@ -18,7 +18,7 @@ package org.jackhuang.hellominecraft.launcher.version;
/** /**
* *
* @author hyh * @author huangyuhui
*/ */
public class OS { public class OS {
public String version, name; public String version, name;

View File

@@ -18,7 +18,7 @@ package org.jackhuang.hellominecraft.launcher.version;
/** /**
* *
* @author hyh * @author huangyuhui
*/ */
public class Rules { public class Rules {
public String action; public String action;

View File

@@ -23,7 +23,7 @@ import javax.swing.JFrame;
/** /**
* *
* @author hyh * @author huangyuhui
*/ */
public class DraggableFrame extends JFrame public class DraggableFrame extends JFrame
implements MouseListener, MouseMotionListener { implements MouseListener, MouseMotionListener {

View File

@@ -66,7 +66,7 @@ import org.jackhuang.hellominecraft.views.Selector;
/** /**
* *
* @author hyh * @author huangyuhui
*/ */
public class GameSettingsPanel extends javax.swing.JPanel { public class GameSettingsPanel extends javax.swing.JPanel {

View File

@@ -26,7 +26,7 @@ import javax.swing.JLabel;
/** /**
* *
* @author hyh * @author huangyuhui
*/ */
public class HeaderTab extends JLabel public class HeaderTab extends JLabel
implements MouseListener { implements MouseListener {

View File

@@ -28,7 +28,7 @@ import org.jackhuang.hellominecraft.utils.system.MessageBox;
/** /**
* *
* @author hyh * @author huangyuhui
*/ */
public class LauncherSettingsPanel extends javax.swing.JPanel { public class LauncherSettingsPanel extends javax.swing.JPanel {

View File

@@ -48,7 +48,7 @@ import org.jackhuang.hellominecraft.views.BasicColors;
/** /**
* *
* @author hyh * @author huangyuhui
*/ */
public final class MainFrame extends DraggableFrame { public final class MainFrame extends DraggableFrame {

View File

@@ -45,7 +45,7 @@ import org.jackhuang.hellominecraft.utils.functions.Consumer;
/** /**
* *
* @author hyh * @author huangyuhui
*/ */
public class MainPagePanel extends javax.swing.JPanel { public class MainPagePanel extends javax.swing.JPanel {

View File

@@ -22,7 +22,7 @@ import org.jackhuang.hellominecraft.utils.StrUtils;
/** /**
* *
* @author hyh * @author huangyuhui
*/ */
public final class NewProfileWindow extends javax.swing.JDialog { public final class NewProfileWindow extends javax.swing.JDialog {

View File

@@ -16,7 +16,7 @@ import org.jackhuang.mojang.authlib.properties.PropertyMap;
/** /**
* *
* @author hyh * @author huangyuhui
*/ */
public class LegacyPropertyMapSerializer public class LegacyPropertyMapSerializer
implements JsonSerializer<PropertyMap> { implements JsonSerializer<PropertyMap> {

View File

@@ -22,7 +22,7 @@ import java.util.ResourceBundle;
/** /**
* *
* @author hyh * @author huangyuhui
*/ */
public final class C { public final class C {
public static final Gson gsonPrettyPrinting = new GsonBuilder().setPrettyPrinting().create(); public static final Gson gsonPrettyPrinting = new GsonBuilder().setPrettyPrinting().create();

View File

@@ -21,7 +21,7 @@ import org.jackhuang.hellominecraft.logging.logger.Logger;
/** /**
* *
* @author hyh * @author huangyuhui
*/ */
public class HMCLog { public class HMCLog {

View File

@@ -23,7 +23,7 @@ import org.jackhuang.hellominecraft.logging.layout.DefaultLayout;
/** /**
* *
* @author hyh * @author huangyuhui
*/ */
public class Configuration { public class Configuration {

View File

@@ -18,7 +18,7 @@ package org.jackhuang.hellominecraft.logging;
/** /**
* *
* @author hyh * @author huangyuhui
*/ */
public enum Level { public enum Level {

View File

@@ -20,7 +20,7 @@ import org.jackhuang.hellominecraft.logging.message.IMessage;
/** /**
* *
* @author hyh * @author huangyuhui
*/ */
public class LogEvent { public class LogEvent {

View File

@@ -18,7 +18,7 @@ package org.jackhuang.hellominecraft.logging;
/** /**
* *
* @author hyh * @author huangyuhui
*/ */
public class LoggingException extends RuntimeException { public class LoggingException extends RuntimeException {

View File

@@ -21,7 +21,7 @@ import org.jackhuang.hellominecraft.logging.layout.ILayout;
/** /**
* *
* @author hyh * @author huangyuhui
*/ */
public abstract class AbstractAppender implements IAppender { public abstract class AbstractAppender implements IAppender {

View File

@@ -23,7 +23,7 @@ import org.jackhuang.hellominecraft.logging.layout.ILayout;
/** /**
* *
* @author hyh * @author huangyuhui
*/ */
public class ConsoleAppender extends OutputStreamAppender { public class ConsoleAppender extends OutputStreamAppender {

View File

@@ -22,7 +22,7 @@ import org.jackhuang.hellominecraft.logging.layout.ILayout;
/** /**
* *
* @author hyh * @author huangyuhui
*/ */
public interface IAppender { public interface IAppender {

View File

@@ -28,7 +28,7 @@ import org.jackhuang.hellominecraft.logging.layout.ILayout;
/** /**
* *
* @author hyh * @author huangyuhui
*/ */
public abstract class OutputStreamAppender extends AbstractAppender { public abstract class OutputStreamAppender extends AbstractAppender {

View File

@@ -20,7 +20,7 @@ import org.jackhuang.hellominecraft.logging.LogEvent;
/** /**
* *
* @author hyh * @author huangyuhui
*/ */
public abstract class AbstractStringLayout implements ILayout<String> { public abstract class AbstractStringLayout implements ILayout<String> {

View File

@@ -22,7 +22,7 @@ import org.jackhuang.hellominecraft.logging.LogEvent;
/** /**
* *
* @author hyh * @author huangyuhui
*/ */
public class DefaultLayout extends AbstractStringLayout { public class DefaultLayout extends AbstractStringLayout {
private static final SimpleDateFormat sdf = new SimpleDateFormat("HH:mm:ss"); private static final SimpleDateFormat sdf = new SimpleDateFormat("HH:mm:ss");

View File

@@ -21,7 +21,7 @@ import org.jackhuang.hellominecraft.logging.LogEvent;
/** /**
* *
* @author hyh * @author huangyuhui
* @param <T> * @param <T>
*/ */
public interface ILayout<T extends Serializable> { public interface ILayout<T extends Serializable> {

View File

@@ -21,7 +21,7 @@ import org.jackhuang.hellominecraft.logging.message.IMessage;
/** /**
* *
* @author hyh * @author huangyuhui
*/ */
public interface ILogger { public interface ILogger {

View File

@@ -18,7 +18,7 @@ package org.jackhuang.hellominecraft.logging.message;
/** /**
* *
* @author hyh * @author huangyuhui
*/ */
public abstract class AbstractMessageFactory public abstract class AbstractMessageFactory
implements IMessageFactory { implements IMessageFactory {

View File

@@ -20,7 +20,7 @@ import java.io.Serializable;
/** /**
* *
* @author hyh * @author huangyuhui
*/ */
public interface IMessage extends Serializable { public interface IMessage extends Serializable {
String getFormattedMessage(); String getFormattedMessage();

View File

@@ -18,7 +18,7 @@ package org.jackhuang.hellominecraft.logging.message;
/** /**
* *
* @author hyh * @author huangyuhui
*/ */
public abstract interface IMessageFactory { public abstract interface IMessageFactory {

View File

@@ -27,7 +27,7 @@ import java.util.Set;
/** /**
* *
* @author hyh * @author huangyuhui
*/ */
public class ParameterizedMessage public class ParameterizedMessage
implements IMessage { implements IMessage {

View File

@@ -18,7 +18,7 @@ package org.jackhuang.hellominecraft.logging.message;
/** /**
* *
* @author hyh * @author huangyuhui
*/ */
public final class ParameterizedMessageFactory extends AbstractMessageFactory { public final class ParameterizedMessageFactory extends AbstractMessageFactory {

View File

@@ -18,7 +18,7 @@ package org.jackhuang.hellominecraft.logging.message;
/** /**
* *
* @author hyh * @author huangyuhui
*/ */
public class SimpleMessage public class SimpleMessage
implements IMessage { implements IMessage {

View File

@@ -18,7 +18,7 @@ package org.jackhuang.hellominecraft.tasks;
/** /**
* *
* @author hyh * @author huangyuhui
*/ */
public interface DoingDoneListener<K> { public interface DoingDoneListener<K> {
/** /**

View File

@@ -18,7 +18,7 @@ package org.jackhuang.hellominecraft.tasks;
/** /**
* *
* @author hyh * @author huangyuhui
*/ */
public abstract class ProgressProvider { public abstract class ProgressProvider {
protected ProgressProviderListener ppl; protected ProgressProviderListener ppl;

View File

@@ -18,7 +18,7 @@ package org.jackhuang.hellominecraft.tasks;
/** /**
* *
* @author hyh * @author huangyuhui
*/ */
public interface ProgressProviderListener { public interface ProgressProviderListener {
void setProgress(int prog, int max); void setProgress(int prog, int max);

View File

@@ -20,7 +20,7 @@ import java.util.Collection;
/** /**
* *
* @author hyh * @author huangyuhui
*/ */
public abstract class Task extends ProgressProvider { public abstract class Task extends ProgressProvider {

View File

@@ -18,7 +18,7 @@ package org.jackhuang.hellominecraft.tasks;
/** /**
* *
* @author hyh * @author huangyuhui
*/ */
public abstract class TaskInfo extends Task { public abstract class TaskInfo extends Task {

View File

@@ -27,7 +27,7 @@ import org.jackhuang.hellominecraft.HMCLog;
/** /**
* *
* @author hyh * @author huangyuhui
*/ */
public class TaskList extends Thread { public class TaskList extends Thread {

View File

@@ -18,7 +18,7 @@ package org.jackhuang.hellominecraft.tasks;
/** /**
* *
* @author hyh * @author huangyuhui
*/ */
public class TaskRunnable extends TaskInfo { public class TaskRunnable extends TaskInfo {
private final Runnable r; private final Runnable r;

View File

@@ -23,7 +23,7 @@ import org.jackhuang.hellominecraft.utils.functions.Consumer;
/** /**
* *
* @author hyh * @author huangyuhui
* @param <T> Runnable&lt;T&gt; * @param <T> Runnable&lt;T&gt;
*/ */
public class TaskRunnableArg1<T> extends TaskInfo implements PreviousResultRegistrator<T> { public class TaskRunnableArg1<T> extends TaskInfo implements PreviousResultRegistrator<T> {

View File

@@ -27,7 +27,7 @@ import org.jackhuang.hellominecraft.utils.SwingUtils;
/** /**
* *
* @author hyh * @author huangyuhui
*/ */
public class TaskWindow extends javax.swing.JDialog public class TaskWindow extends javax.swing.JDialog
implements ProgressProviderListener, NonConsumer, DoingDoneListener<Task> { implements ProgressProviderListener, NonConsumer, DoingDoneListener<Task> {

View File

@@ -18,7 +18,7 @@ package org.jackhuang.hellominecraft.tasks.communication;
/** /**
* *
* @author hyh * @author huangyuhui
* @param <T> Task result type * @param <T> Task result type
*/ */
public interface PreviousResult<T> { public interface PreviousResult<T> {

View File

@@ -20,7 +20,7 @@ import org.jackhuang.hellominecraft.tasks.Task;
/** /**
* *
* @author hyh * @author huangyuhui
* @param <T> Previous task result type * @param <T> Previous task result type
*/ */
public interface PreviousResultRegistrator<T> { public interface PreviousResultRegistrator<T> {

View File

@@ -21,7 +21,7 @@ import org.jackhuang.hellominecraft.views.LogWindow;
/** /**
* *
* @author hyh * @author huangyuhui
*/ */
public class ContentGetAndShowTask extends HTTPGetTask implements Event<String> { public class ContentGetAndShowTask extends HTTPGetTask implements Event<String> {

View File

@@ -20,7 +20,7 @@ import org.jackhuang.hellominecraft.tasks.ProgressProviderListener;
/** /**
* *
* @author hyh * @author huangyuhui
*/ */
public interface DownloadListener extends ProgressProviderListener { public interface DownloadListener extends ProgressProviderListener {

View File

@@ -38,7 +38,7 @@ import org.jackhuang.hellominecraft.utils.system.IOUtils;
/** /**
* *
* @author hyh * @author huangyuhui
*/ */
// This class downloads a file from a URL. // This class downloads a file from a URL.
public class FileDownloadTask extends Task implements PreviousResult<File>, PreviousResultRegistrator<String> { public class FileDownloadTask extends Task implements PreviousResult<File>, PreviousResultRegistrator<String> {

View File

@@ -27,7 +27,7 @@ import org.jackhuang.hellominecraft.utils.EventHandler;
/** /**
* *
* @author hyh * @author huangyuhui
*/ */
public class HTTPGetTask extends TaskInfo implements PreviousResult<String> { public class HTTPGetTask extends TaskInfo implements PreviousResult<String> {

View File

@@ -18,7 +18,7 @@ package org.jackhuang.hellominecraft.tasks.download;
/** /**
* *
* @author hyh * @author huangyuhui
*/ */
public class NetException extends RuntimeException { public class NetException extends RuntimeException {

View File

@@ -22,7 +22,7 @@ import java.util.Map;
/** /**
* *
* @author hyh * @author huangyuhui
*/ */
public class ArrayUtils { public class ArrayUtils {

View File

@@ -24,7 +24,7 @@ import java.util.Iterator;
/** /**
* *
* @author hyh * @author huangyuhui
*/ */
public final class CollectionUtils { public final class CollectionUtils {
public static <T> void forEach(Collection<T> coll, Consumer<T> p) { public static <T> void forEach(Collection<T> coll, Consumer<T> p) {

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