Compare commits

..
Author SHA1 Message Date
huangyuhui 112a3b1a86 add api 2016-01-01 13:03:37 +08:00
huangyuhui f3dc605491 test 2016-01-01 12:58:45 +08:00
317 changed files with 48805 additions and 1303 deletions

No files matched your search

Binary file not shown.

After

Width:  |  Height:  |  Size: 35 KiB

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 5.2 KiB

@@ -0,0 +1,305 @@
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package org.jackhuang.hellominecraftlauncher;
import org.jackhuang.hellominecraftlauncher.apis.LogUtils;
import org.jackhuang.hellominecraftlauncher.apis.DoneListener;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStreamWriter;
import java.io.UnsupportedEncodingException;
import java.util.ArrayList;
import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;
import org.jackhuang.hellominecraftlauncher.apis.handlers.Login;
import org.jackhuang.hellominecraftlauncher.apis.handlers.LoginInfo;
import org.jackhuang.hellominecraftlauncher.apis.handlers.LoginResult;
import org.jackhuang.hellominecraftlauncher.apis.PluginHandlerType;
import org.jackhuang.hellominecraftlauncher.apis.version.MinecraftLibrary;
import org.jackhuang.hellominecraftlauncher.loaders.MinecraftLoader;
import org.jackhuang.hellominecraftlauncher.loaders.MinecraftOldLoader;
import org.jackhuang.hellominecraftlauncher.plugin.PluginHandler;
import org.jackhuang.hellominecraftlauncher.utilities.SettingsManager;
import org.jackhuang.hellominecraftlauncher.settings.Version;
import org.jackhuang.hellominecraftlauncher.utilities.C;
import org.jackhuang.hellominecraftlauncher.apis.utils.MessageBox;
import org.jackhuang.hellominecraftlauncher.apis.utils.OperatingSystems;
import org.jackhuang.hellominecraftlauncher.apis.utils.Utils;
import org.jackhuang.hellominecraftlauncher.apis.utils.Compressor;
import org.jackhuang.hellominecraftlauncher.apis.version.MinecraftVersion;
/**
*
* @author hyh
*/
public class GameLauncher {
private static String makeCommand(List<String> cmd) {
StringBuilder cmdbuf = new StringBuilder(120);
for (int i = 0; i < cmd.size(); i++) {
if (i > 0) {
cmdbuf.append(' ');
}
String s = cmd.get(i);
if (s.indexOf(' ') >= 0 || s.indexOf('\t') >= 0) {
if (s.charAt(0) != '"') {
cmdbuf.append('"');
cmdbuf.append(s);
if (s.endsWith("\\")) {
cmdbuf.append("\\");
}
cmdbuf.append('"');
} else if (s.endsWith("\"")) {
/* The argument has already been quoted. */
cmdbuf.append(s);
} else {
/* Unmatched quote for the argument. */
throw new IllegalArgumentException();
}
} else {
cmdbuf.append(s);
}
}
String str = cmdbuf.toString();
return str;
}
Version get;
LoginInfo info;
Login login;
ArrayList<ArrayList<DoneListener<List, GameLauncher>>> listeners;
public GameLauncher(Version version, LoginInfo info, int loginType) {
this.get = version;
this.info = info;
listeners = new ArrayList<ArrayList<DoneListener<List, GameLauncher>>>(101);
for (int i = 0; i < 101; i++) {
listeners.add(new ArrayList<DoneListener<List, GameLauncher>>());
}
this.login = (Login)PluginHandler.getPluginHandlers(PluginHandlerType.getType("LOGIN")).get(loginType);
}
private void executeEvent(int eventType, List p) {
for (DoneListener<List, GameLauncher> dl : listeners.get(eventType)) {
dl.onDone(p, this);
}
}
public void addListener(int eventType, DoneListener<List, GameLauncher> dl) {
listeners.get(eventType).add(dl);
}
public void makeLaunchCommand() {
ArrayList al = new ArrayList();
LoginResult result;
if(info != null)
result = login.login(info);
else
result = login.loginBySettings();
if (result == null || result.success == false) {
String error;
if (result == null || result.error == null) {
error = C.I18N.getString("登录失败:") + C.I18N.getString("插件错误");
} else {
error = C.I18N.getString("登录失败:") + result.error;
}
al.add(error);
executeEvent(0, al);
return;
}
String name = get.name;
final String realpa = Utils.addSeparator(Utils.getGameDir(get, SettingsManager.settings.publicSettings.gameDir));
if (get.isVer16) {
String minecraftJar = realpa
+ "versions" + File.separator + name + File.separator + name
+ ".jar";
String minecraftJarTo = realpa
+ "versions" + File.separator + name + File.separator + name
+ "-HMCL-MERGE-TEMP.jar";
if (get.minecraftJar != null && !get.minecraftJar.isEmpty()) {
String unzipDir = Utils.addSeparator(Utils.currentDir())
+ "HMCL-MERGE-TEMP" + File.separator;
Compressor.unzip(minecraftJar, unzipDir);
for (int i = 0; i < get.minecraftJar.size(); i++) {
if (get.minecraftJarIsActive == null || get.minecraftJarIsActive.get(i)) {
Compressor.unzip(get.minecraftJar.get(i), unzipDir);
}
}
Compressor.zip(unzipDir, minecraftJarTo);
Utils.deleteAll(new File(unzipDir));
minecraftJar = minecraftJarTo;
}
MinecraftVersion mv = Utils.getMinecraftVersion(get, SettingsManager.settings.publicSettings.gameDir);
if (mv.minimumLauncherVersion > Main.minimumLauncherVersion) {
MessageBox.Show("对不起,本启动器现在可能不能启动这个版本的Minecraft,但启动器还是会尝试启动");
}
final MinecraftLoader ml = new MinecraftLoader(mv,
SettingsManager.settings.publicSettings, get, result,
minecraftJar);
//Find assets
//Find, download & unzip libraries
MinecraftVersion v = (ml).getVersion();
File file = new File(realpa + "versions" + File.separator + name + File.separator + name + "-natives");
Utils.deleteAll(file);
file.mkdirs();
ArrayList<String[]> unzippings = new ArrayList<String[]>();
ArrayList<String[]> downloadLibraries = new ArrayList<String[]>();
for (int i = 0; i < v.libraries.size(); i++) {
MinecraftLibrary l = v.libraries.get(i);
if (l.allow()) {
File ff = new File(realpa + "libraries" + File.separator
+ l.formatted);
if (!ff.exists()) {
new File(ff.getParent()).mkdirs();
final String location = l.formatted.replace('\\', '/');
String[] lib = new String[3];
lib[0] = location;
lib[1] = C.URL_LIBRARIES[SettingsManager.settings.downloadtype] + location;
lib[2] = ff.getPath();
downloadLibraries.add(lib);
}
}
if (l.natives != null && l.allow()) {
String[] unzip = new String[2];
unzip[0] = realpa + "libraries" + File.separator + l.formatted;
unzip[1] = realpa + "versions" + File.separator
+ name + File.separator + name + "-natives";
unzippings.add(unzip);
}
}
executeEvent(2, downloadLibraries);
executeEvent(3, unzippings);
executeEvent(100, ml.makeLaunchingCommand());
} else {
String minecraftJar = realpa + "bin" + File.separator + "minecraft.jar";
String minecraftJarTo = realpa + "bin" + File.separator + "minecraft-HMCL-MERGE-TEMP.jar";
if (get.minecraftJar != null && !get.minecraftJar.isEmpty()) {
String unzipDir = Utils.addSeparator(Utils.currentDir())
+ "HMCL-MERGE-TEMP" + File.separator;
Compressor.unzip(minecraftJar, unzipDir);
for (int i = 0; i < get.minecraftJar.size(); i++) {
if (get.minecraftJarIsActive == null || get.minecraftJarIsActive.get(i)) {
Compressor.unzip(get.minecraftJar.get(i), unzipDir);
}
}
Compressor.zip(unzipDir, minecraftJarTo);
Utils.deleteAll(new File(unzipDir));
minecraftJar = minecraftJarTo;
}
String command;
MinecraftOldLoader loader = new MinecraftOldLoader(
SettingsManager.settings.publicSettings, get, result,
minecraftJar);
command = makeCommand(loader.makeLaunchingCommand());
al.add(command);
executeEvent(100, al);
}
}
/**
* Launch the game "as soon as possible".
* @param str launch command
*/
public void launch(List str) {
try {
Process p;
File dir = new File(Utils.getGameDir(get, SettingsManager.settings.publicSettings.gameDir));
String appdata = dir.getParent();
LogUtils.info("APPDATA: " + appdata);
ProcessBuilder builder = new ProcessBuilder(str);
builder.environment().put("APPDATA", appdata);
builder.directory(dir);
p = builder.start();
ArrayList<JavaProcess> al = new ArrayList<JavaProcess>();
al.add(new JavaProcess(str, p));
executeEvent(4, al);
} catch (IOException e) {
e.printStackTrace();
MessageBox.Show(C.I18N.getString("启动失败"));
}
}
/**
* According to the name...
*
* @param launcherName the name of launch bat/sh
* @param str launch command
*/
public void makeLauncher(String launcherName, List str) {
OperatingSystems os = Utils.os();
String gameDir = Utils.getGameDir(get, SettingsManager.settings.publicSettings.gameDir);
File f;
boolean isWin = os == OperatingSystems.WINDOWS;
if (isWin) {
f = new File(launcherName + ".bat");
} else {
f = new File(launcherName + ".sh");
}
if (!f.exists()) {
try {
f.createNewFile();
} catch (IOException ex) {
throw new RuntimeException(ex);
}
}
BufferedWriter writer = null;
try {
writer = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(f), System.getProperty("sun.jnu.encoding", "gbk")));
} catch (FileNotFoundException ex) {
throw new RuntimeException(ex);
} catch (UnsupportedEncodingException ex) {
Logger.getLogger(GameLauncher.class.getName()).log(Level.SEVERE, null, ex);
try {
writer = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(f)));
} catch (FileNotFoundException ex1) {
throw new RuntimeException(ex1);
}
}
if (isWin) {
File dir = new File(gameDir);
String appdata = dir.getParent();
if (appdata != null) {
try {
writer.write("set appdata=" + appdata);
writer.newLine();
} catch (IOException ex) {
System.err.println("Failed to write.");
ex.printStackTrace();
}
}
}
try {
writer.write(makeCommand(str));
writer.close();
} catch (IOException ex) {
Logger.getLogger(GameLauncher.class.getName()).log(Level.SEVERE, null, ex);
}
if (!isWin) {
try {
Runtime.getRuntime().exec("chmod +x launch.sh");
} catch (Exception e) {
e.printStackTrace();
}
}
}
}
@@ -0,0 +1,19 @@
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package org.jackhuang.hellominecraftlauncher;
/**
*
* @author hyh
*/
public enum GameLauncherRequest {
ERROR,
DOWNLOAD_ASSETS,
DOWNLOAD_LIBRARIES,
UNZIP_LIBRARIES,
PROCESS_STARTED,
SUCCEED
}
@@ -0,0 +1,238 @@
# To change this template, choose Tools | Templates
# and open the template in the editor.
\u6e38\u620f\u7248\u672c=\u6e38\u620f\u7248\u672c
\u8fd9\u4e2aMINECRAFT\u6587\u4ef6\u5939\u65e2\u4e0d\u662f1.6\u7248\u4e5f\u4e0d\u662f\u65e7\u7248\u7684\u600e\u4e48\u5bfc\u5165\u561b0V0\u3002=\u8fd9\u4e2aminecraft\u6587\u4ef6\u5939\u65e2\u4e0d\u662f1.6\u7248\u4e5f\u4e0d\u662f\u65e7\u7248\u7684\u600e\u4e48\u5bfc\u5165\u561b0v0\u3002
\u672a\u9009\u4e2d\u4efb\u4f55\u4e00\u4e2a\u7248\u672c=\u672a\u9009\u4e2d\u4efb\u4f55\u4e00\u4e2a\u7248\u672c
\u5bfc\u5165\u5931\u8d25\:\ {0}=\u5bfc\u5165\u5931\u8d25: {0}
\u627e\u5230\u540c\u540d\u7684MINECRAFT\u7248\u672c\uff0c\u8bf7\u6362\u7528\u53e6\u4e00\u4e2a\u540d\u79f0=\u627e\u5230\u540c\u540d\u7684Minecraft\u7248\u672c\uff0c\u8bf7\u6362\u7528\u53e6\u4e00\u4e2a\u540d\u79f0
\u8bf7\u8f93\u5165\u8be5\u65e7\u7248\u672c\u7684\u540d\u79f0=\u8bf7\u8f93\u5165\u8be5\u65e7\u7248\u672c\u7684\u540d\u79f0
\u627e\u4e0d\u5230MINECRAFT.JAR=\u627e\u4e0d\u5230minecraft.jar
\u9009\u62e9MINECRAFT\u8def\u5f84=\u9009\u62e9Minecraft\u8def\u5f84
\u542f\u52a8\u5931\u8d25=\u542f\u52a8\u5931\u8d25
\u590d\u5236\u914d\u7f6e\u6587\u4ef6\u5931\u8d25\:\ =\u590d\u5236\u914d\u7f6e\u6587\u4ef6\u5931\u8d25:
\u590d\u5236\u6838\u5fc3\u6a21\u7ec4\u5931\u8d25\:\ =\u590d\u5236\u6838\u5fc3\u6a21\u7ec4\u5931\u8d25:
\u590d\u5236\u666e\u901a\u6a21\u7ec4\u5931\u8d25\:\ =\u590d\u5236\u666e\u901a\u6a21\u7ec4\u5931\u8d25:
\u4e0b\u8f7d\u7f3a\u5931\u5e93\uff1a{0}=\u4e0b\u8f7d\u7f3a\u5931\u5e93\uff1a{0}
\u6ca1\u6709\u9009\u62e9\u4efb\u4f55\u4e00\u4e2aMINECRAFT\u7248\u672c=\u6ca1\u6709\u9009\u62e9\u4efb\u4f55\u4e00\u4e2aMinecraft\u7248\u672c
\u9519\u8bef\u7684MINECRAFT\u8def\u5f84=\u9519\u8bef\u7684Minecraft\u8def\u5f84
\u5173\u4e8e=\u5173\u4e8e
\u4e0b\u8f7d=\u4e0b\u8f7d
\u5bc6\u7801=\u5bc6\u7801
\u624b\u52a8\u8bbe\u7f6e=\u624b\u52a8\u8bbe\u7f6e
\u4e0d\u9650\u5236=\u4e0d\u9650\u5236
32\u4f4d=32\u4f4d
64\u4f4d=64\u4f4d
\u542f\u52a8\u6a21\u5f0f=\u542f\u52a8\u6a21\u5f0f
\u6700\u5927\u5185\u5b58=\u6700\u5927\u5185\u5b58
\u6e38\u620f\u540d\u79f0=\u540d\u5b57
\u6e38\u620f\u8def\u5f84=\u6e38\u620f\u8def\u5f84
\u5bfc\u5165\u6587\u4ef6\u5939=\u5bfc\u5165\u6587\u4ef6\u5939
\u65b0\u5efa=\u65b0\u5efa
\u5220\u9664=\u5220\u9664
\u7f16\u8f91=\u7f16\u8f91
\u590d\u5236=\u590d\u5236
\u5bfc\u5165\u65e7\u7248\u672c=\u5bfc\u5165\u65e7\u7248\u672c
\u5236\u4f5c\u4e00\u952e\u542f\u52a8=\u5236\u4f5c\u4e00\u952e\u542f\u52a8
\u51c6\u5907\u4e2d=\u51c6\u5907\u4e2d
\u5f00\u59cbMINECRAFT\u4e4b\u65c5!=\u542f\u52a8\u6e38\u620f
\u5237\u65b0=\u5237\u65b0
public_settings=\u5168\u5c40\u8bbe\u7f6e
game_download=\u6e38\u620f\u4e0b\u8f7d
\u66f4\u65b0\u4fe1\u606f=\u66f4\u65b0\u4fe1\u606f
\u8bbe\u7f6e\u5931\u8d25\uff1a=\u8bbe\u7f6e\u5931\u8d25\uff1a
\u7f3a\u5931\u5e93\u4e0b\u8f7d=\u7f3a\u5931\u5e93\u4e0b\u8f7d
\u9009\u62e9\u80cc\u666f\u8def\u5f84=\u9009\u62e9\u80cc\u666f\u8def\u5f84
MineLogin0=\u7f51\u7edc\u9519\u8bef
MineLogin1=\u7528\u6237\u540d\u6216\u5bc6\u7801\u4e0d\u5408\u6cd5
MineLogin2=\u5185\u90e8\u9519\u8bef
MineLogin3=\u7528\u6237\u4e0d\u5b58\u5728
MineLogin4=\u9700\u8981\u9a8c\u8bc1
MineLogin5=\u5bc6\u7801\u9519\u8bef
ForgeMod=Forge mod
ModLoaderMod=ModLoader mod
Forge=Forge
ModLoader=ModLoader
Unknown=\u672a\u77e5
Mods\u6587\u4ef6\u5939=Mods\u6587\u4ef6\u5939
Coremods\u6587\u4ef6\u5939=Coremods\u6587\u4ef6\u5939
Mod\u72ec\u7acb\u6587\u4ef6\u5939=Mod\u72ec\u7acb\u6587\u4ef6\u5939
\u914d\u7f6e\u6587\u4ef6\u5939=\u914d\u7f6e\u6587\u4ef6\u5939
\u767b\u5f55\u5931\u8d25\uff1a=\u767b\u5f55\u5931\u8d25\uff1a
\u9009\u62e9\u5931\u8d25=\u9009\u62e9\u5931\u8d25
\u63d2\u4ef6\u9519\u8bef\uff1a=\u63d2\u4ef6\u9519\u8bef\uff1a
\u767b\u5f55\u5931\u8d25\uff1a=\u767b\u5f55\u5931\u8d25\uff1a
\u6ca1\u6709\u767b\u5165\u65b9\u5f0f...=\u6ca1\u6709\u767b\u5165\u65b9\u5f0f...
\u4fdd\u5b58=\u4fdd\u5b58
\u767b\u5f55\u6a21\u5f0f=\u767b\u5f55\u6a21\u5f0f
\u7248\u672c\u7f16\u8f91=\u7248\u672c\u7f16\u8f91
\u7248\u672c\u53f7=\u7248\u672c\u53f7
\u5bfc\u5165=\u5bfc\u5165
\u64cd\u4f5c=\u64cd\u4f5c
\u4e0b\u8f7d\u4fe1\u606f=\u4e0b\u8f7d\u4fe1\u606f
\u5b89\u88c5=\u5b89\u88c5
\u6dfb\u52a0=\u6dfb\u52a0
\u5168\u90e8\u4e0b\u8f7d=\u5168\u90e8\u4e0b\u8f7d
\u52a0\u5165MINECRAFT.JAR=\u52a0\u5165minecraft.jar
\u7ba1\u7406=\u7ba1\u7406
\u52a8\u6001\u52a0\u8f7d\u6a21\u7ec4=\u52a8\u6001\u52a0\u8f7d\u6a21\u7ec4
\u5e93=\u5e93
AdvancedSettings=\u9ad8\u7ea7\u8bbe\u7f6e
\u6700\u5927\u5316=\u6700\u5927\u5316
\u68c0\u67e5\u66f4\u65b0=\u68c0\u67e5\u66f4\u65b0
\u67e5\u770b\u65e5\u5fd7=\u67e5\u770b\u65e5\u5fd7
\u80cc\u666f\u5730\u5740=\u80cc\u666f\u5730\u5740
UNEXPECTED\ EXCEPTION\ LOADING\ =Unexpected exception loading
\u5f53\u524d\u662f\u6700\u65b0\u7248\u672c=\u5f53\u524d\u662f\u6700\u65b0\u7248\u672c
\u65e0\u6cd5\u6253\u5f00\u6d4f\u89c8\u5668\uff0c\u7f51\u5740\u5df2\u7ecf\u590d\u5236\u5230\u526a\u8d34\u677f\u4e86\uff0c\u60a8\u53ef\u4ee5\u624b\u52a8\u7c98\u8d34\u7f51\u5740\u6253\u5f00\u9875\u9762=\u65e0\u6cd5\u6253\u5f00\u6d4f\u89c8\u5668\uff0c\u7f51\u5740\u5df2\u7ecf\u590d\u5236\u5230\u526a\u8d34\u677f\u4e86\uff0c\u60a8\u53ef\u4ee5\u624b\u52a8\u7c98\u8d34\u7f51\u5740\u6253\u5f00\u9875\u9762
\u662f\u5426\u524d\u5f80\u53d1\u5e03\u9875\u9762\u66f4\u65b0\uff1f=\u662f\u5426\u524d\u5f80\u53d1\u5e03\u9875\u9762\u66f4\u65b0\uff1f
\u66f4\u65b0\u4fe1\u606f\u4e3a\:\ =\u66f4\u65b0\u4fe1\u606f\u4e3a:
\u6700\u65b0\u7248\u672c\u4e3a\uff1a=\u6700\u65b0\u7248\u672c\u4e3a\uff1a
\u68c0\u67e5\u66f4\u65b0\u5931\u8d25=\u68c0\u67e5\u66f4\u65b0\u5931\u8d25
\u8fde\u63a5\u4e2d=\u8fde\u63a5\u4e2d
\u83b7\u53d6\u5217\u8868\u5931\u8d25\uff0c\u8bf7\u5237\u65b0\u91cd\u8bd5=\u83b7\u53d6\u5217\u8868\u5931\u8d25\uff0c\u8bf7\u5237\u65b0\u91cd\u8bd5
INVALID\ PLUGIN=Invalid plugin
\u65e0\u6cd5\u8fde\u63a5=\u65e0\u6cd5\u8fde\u63a5
\ \u5dee\ ORANGERED=\ \u5dee orangered
\ \u8f83\u5dee\ ORANGE=\ \u8f83\u5dee orange
\ \u4e2d\ YELLOGREEN=\ \u4e2d yellogreen
\ \u8f83\u597d\ BLUE=\ \u8f83\u597d blue
\ \u597d\ GREEN=\ \u597d green
\u670d\u52a1\u5668{0}\u7684\u56de\u590d\u65e0\u6548=\u670d\u52a1\u5668{0}\u7684\u56de\u590d\u65e0\u6548
ForgeInstall=\u63a5\u4e0b\u6765\u5f39\u51fa\u6765\u7684\u7a97\u53e3\u91cc\u8bf7\u9009\u62e9\u8def\u5f84\u4e3a\u6e38\u620f\u8def\u5f84\u3002\u7a0b\u5e8f\u5df2\u7ecf\u5c06\u76ee\u5f55\u590d\u5236\u5230\u4e86\u526a\u8d34\u677f\uff0c\u76f4\u63a5\u5728\u7a97\u53e3\u91cc\u9009\u62e9"..."\u6309\u94ae\uff0c\u7c98\u8d34\u8def\u5f84\uff0c\u786e\u5b9a\u5373\u53ef
\u65e0\u6cd5\u6253\u5f00\u8d44\u6e90\u7ba1\u7406\u5668\:\ =\u65e0\u6cd5\u6253\u5f00\u8d44\u6e90\u7ba1\u7406\u5668:
\u63d0\u793a=\u63d0\u793a
\u8f93\u5165\u65b0\u7248\u672c\u540d\u79f0=\u8f93\u5165\u65b0\u7248\u672c\u540d\u79f0
\u540d\u79f0=\u540d\u79f0
\u4fdd\u5b58\u5931\u8d25=\u4fdd\u5b58\u5931\u8d25
\u4fdd\u5b58\u538b\u7f29\u5305\u5230=\u4fdd\u5b58\u538b\u7f29\u5305\u5230
\u9009\u62e9\u6750\u8d28\u5305=\u9009\u62e9\u6750\u8d28\u5305
\u9009\u62e9\u8d44\u6e90\u5305=\u9009\u62e9\u8d44\u6e90\u5305
\u9009\u62e9\u5e93/\u6a21\u7ec4=\u9009\u62e9\u5e93/\u6a21\u7ec4
\u6ca1\u6709\u9009\u4e2d\u4efb\u4f55\u4e00\u4e2a\u5e93/\u6a21\u7ec4\u3002=\u6ca1\u6709\u9009\u4e2d\u4efb\u4f55\u4e00\u4e2a\u5e93/\u6a21\u7ec4\u3002
\u5220\u9664\u5931\u8d25=\u5220\u9664\u5931\u8d25
\u6dfb\u52a0\u5931\u8d25=\u6dfb\u52a0\u5931\u8d25
\u9009\u62e9\u6a21\u7ec4=\u9009\u62e9\u6a21\u7ec4
\u7248\u672c\u540d\u79f0\u4e0d\u80fd\u4e3a\u7a7a=\u7248\u672c\u540d\u79f0\u4e0d\u80fd\u4e3a\u7a7a
\u5907\u4efd\u5230=\u5907\u4efd\u5230
\u662fCOREODS\u6587\u4ef6\u5939\u5185\u7684\u6240\u6709\u6838\u5fc3\u6a21\u7ec4=\u662fCoremods\u6587\u4ef6\u5939\u5185\u7684\u6240\u6709\u6838\u5fc3\u6a21\u7ec4
\u662fMODS\u6587\u4ef6\u5939\u5185\u7684\u6240\u6709\u6a21\u7ec4=\u662fMods\u6587\u4ef6\u5939\u5185\u7684\u6240\u6709\u6a21\u7ec4
\u901a\u5e38\u662f\u6a21\u7ec4=\u901a\u5e38\u662f\u6a21\u7ec4
\u4e0b\u79fb=\u4e0b\u79fb
\u4e0a\u79fb=\u4e0a\u79fb
\u5220\u9664=\u5220\u9664
\u589e\u52a0=\u589e\u52a0
\u901a\u5e38\u662fFORGE,MODLOADER\u4ee5\u53caMINECRAFT\u6240\u4f9d\u8d56\u7684\u5e93=\u901a\u5e38\u662fForge,Modloader\u4ee5\u53caMinecraft\u6240\u4f9d\u8d56\u7684\u5e93
\u9644\u52a0\u542f\u52a8\u53c2\u6570=\u9644\u52a0\u542f\u52a8\u53c2\u6570
\u81ea\u5b9a\u4e49\u5e93\u6587\u4ef6\u5939(LIBRARIES\u6587\u4ef6\u5939)=\u81ea\u5b9a\u4e49\u5e93\u6587\u4ef6\u5939(libraries\u6587\u4ef6\u5939)
\u4e3b\u7c7b=\u4e3b\u7c7b
\u81ea\u5b9a\u4e49\u8d44\u6e90\u6587\u4ef6\u5939(ASSETS\u6587\u4ef6\u5939)=\u81ea\u5b9a\u4e49\u8d44\u6e90\u6587\u4ef6\u5939(assets\u6587\u4ef6\u5939)
\u624b\u52a8\u8bbe\u7f6e=\u624b\u52a8\u8bbe\u7f6e
\u4e0d\u5f3a\u5236=\u4e0d\u5f3a\u5236
32\u4f4d=32\u4f4d
64\u4f4d=64\u4f4d
\u542f\u52a8\u6a21\u5f0f=\u542f\u52a8\u6a21\u5f0f
\u73a9\u5bb6\u540d=\u73a9\u5bb6\u540d
1.6\u53ca\u4ee5\u4e0a\u7248\u672c\u4ee5\u53ca\u5bfc\u5165\u7684\u65e7\u7248\u672c=1.6\u53ca\u4ee5\u4e0a\u7248\u672c\u4ee5\u53ca\u5bfc\u5165\u7684\u65e7\u7248\u672c
\u6700\u5927\u5185\u5b58=\u6700\u5927\u5185\u5b58\uff08MB\uff09
JAVA\u865a\u62df\u673a\u53c2\u6570=Java\u865a\u62df\u673a\u53c2\u6570
JAVA\u8def\u5f84=Java\u8def\u5f84
\u5168\u5c4f=\u5168\u5c4f
\u5206\u8fa8\u7387=\u5206\u8fa8\u7387
\u6e38\u620f\u8def\u5f84=\u6e38\u620f\u8def\u5f84
\u4ee5\u4e0b\u8bbe\u7f6e\u5b57\u6bb5\u4e3a\u7a7a\u4ee3\u8868\u7740\u4f7f\u7528\u9ed8\u8ba4\u8bbe\u7f6e=\u9664\u540d\u79f0\u4ee5\u4e0b\u5b57\u6bb5\u53ef\u4ee5\u4e0d\u586b
\u53d6\u6d88=\u53d6\u6d88
\u786e\u5b9a=\u786e\u5b9a
game_download=\u6e38\u620f\u4e0b\u8f7d
public_settings=\u5168\u5c40\u8bbe\u7f6e
invalid=\u65e0\u6548\u7684
invalid_jar=\u65e0\u6548\u7684jar\u5305
not_a_file=\u4e0d\u662f\u6587\u4ef6
not_found=\u627e\u4e0d\u5230minecraft.jar
not_readable=minecraft.jar\u4e0d\u53ef\u8bfb
modified=(\u4fee\u6539\u7684!)
\u83b7\u53d6\u4e2d=\u83b7\u53d6\u4e2d
\u63d2\u4ef6\u9519\u8bef=\u63d2\u4ef6\u9519\u8bef
CannotLoadPluginsBecauseOfAnError=\u65e0\u6cd5\u52a0\u8f7d\u63d2\u4ef6\uff0c\u56e0\u4e3a\u53d1\u751f\u4e86\u4e00\u4e2a\u9519\u8bef\u3002
CRASH\ REPORT\ DETECTED,\ BUT\ UNKNOWN\ FORMAT\:=Crash report detected, but unknown format:
COULDN'T\ OPEN\ CRASH\ REPORT=Couldn't open crash report
CRASH\ REPORT\ DETECTED,\ OPENING\:=Crash report detected, opening:
MinecraftCrashed=Minecraft\u5d29\u6e83\u4e86\uff01(\u9519\u8bef\u4ee3\u7801:{0})
RememberMe=\u8bb0\u4f4f\u6211
Logout=\u767b\u51fa
ShowIfIsLoaded=\u663e\u793a\u63d2\u4ef6\u662f\u5426\u52a0\u8f7d\uff0c\u70b9\u51fb\u67e5\u770b\u9519\u8bef
IsLoaded=\u662f\u5426\u52a0\u8f7d
PluginSettings=\u63d2\u4ef6\u8bbe\u7f6e
Details=\u4fe1\u606f
Authors=\u4f5c\u8005
Version=\u7248\u672c
Name=\u540d\u79f0
CheckUpdate=\u68c0\u67e5\u672c\u542f\u52a8\u5668\u7684\u66f4\u65b0
DownloadSource=\u4e0b\u8f7d\u6e90
DisableMoveMods=\u7981\u6b62\u7248\u672c\u81ea\u6709\u6a21\u7ec4\uff08\u79fb\u52a8\u6a21\u7ec4\uff09\u529f\u80fd
ShowConsoleOutput=\u5c31\u662fMinecraft\u7684\u63a7\u5236\u53f0\u8f93\u51fa
MinecraftLocation=Minecraft\u8def\u5f84\uff08\u5373.minecraft\u6587\u4ef6\u5939\uff09
MaxMemoryTooltip=\u5141\u8bb8Minecraft\u6700\u591a\u5141\u8bb8\u4f7f\u7528\u7684\u5185\u5b58\uff08\u770b\u4e0d\u61c2\u5c31\u4f7f\u7528\u9ed8\u8ba4\u76841024\u5427\uff09
FailedToLoad=\u52a0\u8f7d\u5931\u8d25
Loaded=\u5df2\u52a0\u8f7d
NoCharacter=\u8be5\u5e10\u53f7\u6ca1\u6709\u89d2\u8272
LegacyLogin=\u65e7\u7248\u6b63\u7248\u767b\u5f55
YggdrasilLogin=\u65b0\u7248\u6b63\u7248\u767b\u5f55
PleaseChooseCharacter=\u8bf7\u9009\u62e9\u60a8\u8981\u4f7f\u7528\u7684\u89d2\u8272
WrongPassword=\u53ef\u80fd\u662f\u60a8\u7684\u7528\u6237\u540d\u6216\u5bc6\u7801\u9519\u8bef
OfflineLogin=\u79bb\u7ebf\u6a21\u5f0f
GameDownload=\u6e38\u620f\u4e0b\u8f7d
IntegrateDownload=\u6574\u5408\u5305\u4e0b\u8f7d
AssetsDownload=\u8d44\u6e90\u4e0b\u8f7d
Installers=\u81ea\u52a8\u5b89\u88c5
WorldSaving=\u5907\u4efd\u5730\u56fe
ServerEditor=\u670d\u52a1\u5668\u7f16\u8f91
TexturepackEditor=\u6750\u8d28\u5305\u7ba1\u7406
Refresh=\u5237\u65b0\u5217\u8868
Install=\u5b89\u88c5
AssetsType=\u8d44\u6e90\u7c7b\u578b
InstallOptifine=\u5b89\u88c5\u9009\u4e2d\u7684Optifine
Changelog=\u66f4\u65b0\u4fe1\u606f
InstallForge=\u5b89\u88c5\u9009\u4e2d\u7684Forge
ModManaging=\u6a21\u7ec4\u7ba1\u7406
PluginCenter=\u63d2\u4ef6\u4e2d\u5fc3
ExtMods=\u5916\u90e8\u6a21\u7ec4
CoreMods=\u6838\u5fc3\u6a21\u7ec4
NormalSettings=\u666e\u901a\u8bbe\u7f6e
1.6AndAbove=1.6\u53ca\u4ee5\u4e0a
1.5AndBelow=1.5\u53ca\u4ee5\u4e0b
IsActive=\u6d3b\u52a8
Location=\u8def\u5f84
Type=\u7c7b\u578b
ReleaseTime=\u91ca\u653e\u65f6\u95f4
Time=\u53d1\u5e03\u65f6\u95f4
Version=\u7248\u672c
MCVersion=MC\u7248\u672c
IntegrateName=\u6574\u5408\u5305\u540d\u79f0
IntegrateVersion=\u6574\u5408\u5305\u7248\u672c
ServerName=\u670d\u52a1\u5668\u540d\u79f0
HideAddress=\u9690\u85cf\u5730\u5740
Address=\u5730\u5740
Introduction=\u4ecb\u7ecd
Online=\u5728\u7ebf
Delay=\u5ef6\u8fdf
Clear=\u6e05\u9664
Close=\u5173\u95ed
Save=\u4fdd\u5b58
JoinMinecraftJar=\u52a0\u5165minecraft.jar
ExternalMods=\u5916\u90e8\u6a21\u7ec4
DynamicLoadingMods=\u52a8\u6001\u52a0\u8f7d\u6a21\u7ec4
Libraries=\u5e93
TagArguments=\u9644\u52a0\u7ed9\u4e88Minecraft\u7684\u53c2\u6570
MainClass=Minecraft\u7684\u4e3b\u7c7b\uff08\u4e0d\u77e5\u9053\u4ec0\u4e48\u610f\u601d\u7684\u8bdd\u4e5f\u5c31\u7528\u4e0d\u4e0a\u4e86\uff09
DefaultLibrariesFolder=\u9ed8\u8ba4\u4e3a.minecraft/libraries\u6587\u4ef6\u5939
DefaultAssetsFolder=\u9ed8\u8ba4\u4e3a.minecraft/assets\u6587\u4ef6\u5939
MakeMCMaximum=\u4f7fMinecraft\u7a97\u53e3\u6700\u5927\u5316
MCFolderFormat=\u5c31\u662fMinecraft\u6587\u4ef6\u5939\u683c\u5f0f
MakeMCFullscreen=\u4f7fMinecraft\u7a97\u53e3\u5168\u5c4f
MCHeight=Minecraft\u7a97\u53e3\u9ad8
MCWidth=Minecraft\u7a97\u53e3\u5bbd
Personalization=\u4e2a\u6027\u5316
MaxPermGen=\u6700\u5927\u6c38\u4e45\u4fdd\u5b58\u533a\u57df\uff08MB\uff09
Options=\u8bbe\u7f6e
Setup=\u8bbe\u7f6e
@@ -0,0 +1,230 @@
\u6e38\u620f\u7248\u672c=Game versions
\u8fd9\u4e2aMINECRAFT\u6587\u4ef6\u5939\u65e2\u4e0d\u662f1.6\u7248\u4e5f\u4e0d\u662f\u65e7\u7248\u7684\u600e\u4e48\u5bfc\u5165\u561b0V0\u3002=This chosen minecraft folder is not a format of version 1.6 above or 1.5 below, so the launcher cannot import it.
\u672a\u9009\u4e2d\u4efb\u4f55\u4e00\u4e2a\u7248\u672c=Not version selected.
\u5bfc\u5165\u5931\u8d25\:\ {0}=Failed to include: {0}
\u627e\u5230\u540c\u540d\u7684MINECRAFT\u7248\u672c\uff0c\u8bf7\u6362\u7528\u53e6\u4e00\u4e2a\u540d\u79f0=Already existed a Minecraft version which has same name, please use another name.
\u8bf7\u8f93\u5165\u8be5\u65e7\u7248\u672c\u7684\u540d\u79f0=Please enter the name of this old version
\u627e\u4e0d\u5230MINECRAFT.JAR=Cannot find minecraft.jar
\u9009\u62e9MINECRAFT\u8def\u5f84=Choose Minecraft path
\u542f\u52a8\u5931\u8d25=Failed to launch
\u590d\u5236\u914d\u7f6e\u6587\u4ef6\u5931\u8d25\:\ =Failed to copy config folder:
\u590d\u5236\u6838\u5fc3\u6a21\u7ec4\u5931\u8d25\:\ =Failed to copy coremods folder:
\u590d\u5236\u666e\u901a\u6a21\u7ec4\u5931\u8d25\:\ =Failed to copy mods foler:
\u4e0b\u8f7d\u7f3a\u5931\u5e93\uff1a{0}=Download missing libraries\uff1a{0}
\u6ca1\u6709\u9009\u62e9\u4efb\u4f55\u4e00\u4e2aMINECRAFT\u7248\u672c=Not version selected.
\u9519\u8bef\u7684MINECRAFT\u8def\u5f84=An erroneous Minecraft path.
\u5173\u4e8e=About
\u4e0b\u8f7d=Download
\u5bc6\u7801=Password
\u624b\u52a8\u8bbe\u7f6e=Select
\u4e0d\u9650\u5236=Default
32\u4f4d=32 bit
64\u4f4d=64 bit
\u542f\u52a8\u6a21\u5f0f=Launch mode
\u6700\u5927\u5185\u5b58=Max memory(MB)
\u6e38\u620f\u540d\u79f0=User name
\u6e38\u620f\u8def\u5f84=Game location
\u5bfc\u5165\u6587\u4ef6\u5939=Import folder
\u65b0\u5efa=New
\u5220\u9664=Delete
\u7f16\u8f91=Edit
\u590d\u5236=Copy
\u5bfc\u5165\u65e7\u7248\u672c=Import old version
\u5236\u4f5c\u4e00\u952e\u542f\u52a8=Make bat/sh launcher
\u51c6\u5907\u4e2d=Preparing
\u5f00\u59cbMINECRAFT\u4e4b\u65c5!=Enjoy Minecraft now!
\u5237\u65b0=Refresh
game_download=Game downloads
public_settings=Public settings
\u8bbe\u7f6e\u5931\u8d25\uff1a=Failed to set\uff1a
\u7f3a\u5931\u5e93\u4e0b\u8f7d=Download missing libraries
\u9009\u62e9\u80cc\u666f\u8def\u5f84=Choose background image path
MineLogin0=Network error
MineLogin1=User name or password is incorrect
MineLogin2=Internal error
MineLogin3=User does not exist
MineLogin4=Need to verify
MineLogin5=Wrong password
ForgeMod=Forge mod
ModLoaderMod=ModLoader mod
Forge=Forge
ModLoader=ModLoader
Unknown=Unknown
Mods\u6587\u4ef6\u5939=Mods folder
Coremods\u6587\u4ef6\u5939=Coremods folder
Mod\u72ec\u7acb\u6587\u4ef6\u5939=Moddir folder
\u914d\u7f6e\u6587\u4ef6\u5939=Config folder
\u767b\u5f55\u5931\u8d25\uff1a=Failed to login
\u9009\u62e9\u5931\u8d25=Failed to select
\u63d2\u4ef6\u9519\u8bef\uff1a=Plugin error\uff1a
\u767b\u5f55\u5931\u8d25\uff1a=Failed to login\uff1a
\u6ca1\u6709\u767b\u5165\u65b9\u5f0f...=No sign...
\u4fdd\u5b58=Save
\u767b\u5f55\u6a21\u5f0f=Log-In mode
\u7248\u672c\u7f16\u8f91=Preferences
\u7248\u672c\u53f7=Version
\u5bfc\u5165=Import
\u64cd\u4f5c=Operations
\u4e0b\u8f7d\u4fe1\u606f=Download Info
\u5b89\u88c5=Install
\u6dfb\u52a0=Add
\u5168\u90e8\u4e0b\u8f7d=Download all
\u52a0\u5165MINECRAFT.JAR=Join minecraft.jar
\u7ba1\u7406=Managings
\u52a8\u6001\u52a0\u8f7d\u6a21\u7ec4=Dynamic Loading Mods
\u5e93=Libraries
AdvancedSettings=Advanced
\u6700\u5927\u5316=Maximized
\u68c0\u67e5\u66f4\u65b0=Check for updates
\u67e5\u770b\u65e5\u5fd7=View Log
\u80cc\u666f\u5730\u5740=Background Location
UNEXPECTED\ EXCEPTION\ LOADING\ =Unexpected exception loading
\u5f53\u524d\u662f\u6700\u65b0\u7248\u672c=This is the latest version
\u65e0\u6cd5\u6253\u5f00\u6d4f\u89c8\u5668\uff0c\u7f51\u5740\u5df2\u7ecf\u590d\u5236\u5230\u526a\u8d34\u677f\u4e86\uff0c\u60a8\u53ef\u4ee5\u624b\u52a8\u7c98\u8d34\u7f51\u5740\u6253\u5f00\u9875\u9762=Unable to open the browser, the URL has been copied to the clipboard, you can paste the URL manually open the page
\u662f\u5426\u524d\u5f80\u53d1\u5e03\u9875\u9762\u66f4\u65b0\uff1f=Do you wish to go to the publishing page to update?
\u66f4\u65b0\u4fe1\u606f\u4e3a\:\ =Update notes:
\u6700\u65b0\u7248\u672c\u4e3a\uff1a=Latest version\uff1a
\u68c0\u67e5\u66f4\u65b0\u5931\u8d25=Failed to check update
\u8fde\u63a5\u4e2d=Connecting
\u83b7\u53d6\u5217\u8868\u5931\u8d25\uff0c\u8bf7\u5237\u65b0\u91cd\u8bd5=Failed to get the list, please retry to refresh
INVALID\ PLUGIN=Invalid plugin
\u65e0\u6cd5\u8fde\u63a5=Unable to connect
\ \u5dee\ ORANGERED=\ Bad orangered
\ \u8f83\u5dee\ ORANGE=\ Not good orange
\ \u4e2d\ YELLOGREEN=\ So-so yellogreen
\ \u8f83\u597d\ BLUE=\ OK blue
\ \u597d\ GREEN=\ Good green
\u670d\u52a1\u5668{0}\u7684\u56de\u590d\u65e0\u6548=The reply of the server {0} is invalid
\u63a5\u4e0b\u6765\u5f39\u51fa\u6765\u7684\u7a97\u53e3\u91cc\u8bf7\u9009\u62e9\u8def\u5f84\u4e3a\u6e38\u620f\u8def\u5f84\u3002\u7a0b\u5e8f\u5df2\u7ecf\u5c06\u76ee\u5f55\u590d\u5236\u5230\u4e86\u526a\u8d34\u677f\uff0c\u76f4\u63a5\u5728\u7a97\u53e3\u91cc\u9009\u62e9\\"...\\"\u6309\u94ae\uff0c\u7c98\u8d34\u8def\u5f84\uff0c\u786e\u5b9a\u5373\u53ef=In the next pop-up window, select the path as the game paths. Launcher has been copied the directory to the clipboard. In the window, choose \\"...\\" button, paste the path, and click OK. It can be determined.
\u65e0\u6cd5\u6253\u5f00\u8d44\u6e90\u7ba1\u7406\u5668\:\ =Can not open Explorer:
\u63d0\u793a=Notice
\u8f93\u5165\u65b0\u7248\u672c\u540d\u79f0=Enter the name of the new version
\u540d\u79f0=Name
\u4fdd\u5b58\u5931\u8d25=Failed to save
\u4fdd\u5b58\u538b\u7f29\u5305\u5230=Save zip file to
\u9009\u62e9\u6750\u8d28\u5305=Choose texture pack
\u9009\u62e9\u8d44\u6e90\u5305=Choose resource pack
\u9009\u62e9\u5e93/\u6a21\u7ec4=Choose library/mod
\u6ca1\u6709\u9009\u4e2d\u4efb\u4f55\u4e00\u4e2a\u5e93/\u6a21\u7ec4\u3002=Not selected any library/mod.
\u5220\u9664\u5931\u8d25=Failed to delete
\u6dfb\u52a0\u5931\u8d25=Failed to add
\u9009\u62e9\u6a21\u7ec4=Choose mod
\u7248\u672c\u540d\u79f0\u4e0d\u80fd\u4e3a\u7a7a=Version name cannot be empty.
\u5907\u4efd\u5230=Backup to
\u662fCOREODS\u6587\u4ef6\u5939\u5185\u7684\u6240\u6709\u6838\u5fc3\u6a21\u7ec4=They're all the core mods in coremods folder.
\u662fMODS\u6587\u4ef6\u5939\u5185\u7684\u6240\u6709\u6a21\u7ec4=They're all the mods in mods folder.
\u901a\u5e38\u662f\u6a21\u7ec4=Usually mods.
\u4e0b\u79fb=Down
\u4e0a\u79fb=Up
\u5220\u9664=Delete
\u589e\u52a0=Add
\u901a\u5e38\u662fFORGE,MODLOADER\u4ee5\u53caMINECRAFT\u6240\u4f9d\u8d56\u7684\u5e93=They're usually Forge, Modloader and libraries.
\u9644\u52a0\u542f\u52a8\u53c2\u6570=Addition arguments
\u81ea\u5b9a\u4e49\u5e93\u6587\u4ef6\u5939(LIBRARIES\u6587\u4ef6\u5939)=Customize libraries folder
\u4e3b\u7c7b=Main class
\u81ea\u5b9a\u4e49\u8d44\u6e90\u6587\u4ef6\u5939(ASSETS\u6587\u4ef6\u5939)=Customize assets folder
\u624b\u52a8\u8bbe\u7f6e=Manually set
\u4e0d\u5f3a\u5236=Default
32\u4f4d=32 bit
64\u4f4d=64 bit
\u542f\u52a8\u6a21\u5f0f=Launch mode
\u73a9\u5bb6\u540d=Player name
1.6\u53ca\u4ee5\u4e0a\u7248\u672c\u4ee5\u53ca\u5bfc\u5165\u7684\u65e7\u7248\u672c=Version 1.6 and above, and imported the old version
\u6700\u5927\u5185\u5b58=Max memory
JAVA\u865a\u62df\u673a\u53c2\u6570=JVM arguments
JAVA\u8def\u5f84=Java path
\u5168\u5c4f=Fullscreen
\u5206\u8fa8\u7387=Resolution
\u6e38\u620f\u8def\u5f84=Game dir
\u4ee5\u4e0b\u8bbe\u7f6e\u5b57\u6bb5\u4e3a\u7a7a\u4ee3\u8868\u7740\u4f7f\u7528\u9ed8\u8ba4\u8bbe\u7f6e=These field could not fill except the name field.
\u53d6\u6d88=Cancel
\u786e\u5b9a=Ok
invalid=invalid
invalid_jar=invalid jar
not_a_file=not a file
not_found=not found
not_readable=not readable
modified=(modified!)
\u83b7\u53d6\u4e2d=Loading
\u63d2\u4ef6\u9519\u8bef=Plugin error
CannotLoadPluginsBecauseOfAnError=Cannot load plugins because an error occurred.
CRASH\ REPORT\ DETECTED,\ BUT\ UNKNOWN\ FORMAT\:=Crash report detected, but unknown format:
COULDN'T\ OPEN\ CRASH\ REPORT=Couldn't open crash report
CRASH\ REPORT\ DETECTED,\ OPENING\:=Crash report detected, opening:
MinecraftCrashed=Minecraft crashed! (Error code: {0})
RememberMe=Remember me
Logout=Log out
ShowIfIsLoaded=To show if plugins are loaded.
IsLoaded=Is loaded
PluginSettings=Plugin settings
Details=Details
Authors=Authors
Version=Version
Name=Name
CheckUpdate=Check for update
DownloadSource=Download source
DisableMoveMods=Disable moving mods.
ShowConsoleOutput=To show Minecraft console output.
MinecraftLocation=Minecraft location
MaxMemoryTooltip=Maximum memory(default 1024)
FailedToLoad=Failed to load
Loaded=Loaded
NoCharacter=No characters
LegacyLogin=Legacy
YggdrasilLogin=Yggdrasil
PleaseChooseCharacter=Please choose the character you want to use.
WrongPassword=Maybe your user name or password is wrong.
OfflineLogin=Offline
GameDownload=Downloads
IntegrateDownload=Integrate Packs
AssetsDownload=Assets
Installers=Installers
WorldSaving=World Backups
ServerEditor=Server List
TexturepackEditor=Texturepacks
Refresh=Refresh
AssetsType=Type
Install=Install
InstallOptifine=Install selected Optifine
Changelog=Changelog
InstallForge=Install selected Forge
ModManaging=Mods
PluginCenter=Plugins
ExtMods=External Mods
CoreMods=Core Mods
NormalSettings=Normal
1.6AndAbove=1.6 And Above
1.5AndBelow=1.5 And Below
IsActive=Active
Location=Location
Type=Type
ReleaseTime=Release Time
Time=Time
Version=Version
MCVersion=MC Version
IntegrateName=Pack Name
IntegrateVersion=Pack Version
ServerName=Server Name
HideAddress=Hide Address
Address=Address
Introduction=Introduction
Online=Online
Delay=Delay
Clear=Clear
Close=Close
Save=Save
JoinMinecraftJar=Join minecraft.jar
ExternalMods=External Mods
DynamicLoadingMods=Dynamic Loading Mods
Libraries=Libraries
TagArguments=Tag Args
MainClass=Minecraft Main Class
DefaultLibrariesFolder=Default: .minecraft/libraries
DefaultAssetsFolder=Default: .minecraft/assets
MakeMCMaximum=Make Minecraft Maximum
MCFolderFormat=Minecraft Folder format
MakeMCFullscreen=Make Minecraft fullscreen
MCHeight=Minecraft window height
MCWidth=Minecraft window width
Personalization=Personalization
MaxPermGen=Max PermGen Size(MB)
@@ -0,0 +1,236 @@
# To change this template, choose Tools | Templates
# and open the template in the editor.
\u6e38\u620f\u7248\u672c=\u6e38\u620f\u7248\u672c
\u8fd9\u4e2aMINECRAFT\u6587\u4ef6\u5939\u65e2\u4e0d\u662f1.6\u7248\u4e5f\u4e0d\u662f\u65e7\u7248\u7684\u600e\u4e48\u5bfc\u5165\u561b0V0\u3002=\u8fd9\u4e2aminecraft\u6587\u4ef6\u5939\u65e2\u4e0d\u662f1.6\u7248\u4e5f\u4e0d\u662f\u65e7\u7248\u7684\u600e\u4e48\u5bfc\u5165\u561b0v0\u3002
\u672a\u9009\u4e2d\u4efb\u4f55\u4e00\u4e2a\u7248\u672c=\u672a\u9009\u4e2d\u4efb\u4f55\u4e00\u4e2a\u7248\u672c
\u5bfc\u5165\u5931\u8d25\:\ {0}=\u5bfc\u5165\u5931\u8d25: {0}
\u627e\u5230\u540c\u540d\u7684MINECRAFT\u7248\u672c\uff0c\u8bf7\u6362\u7528\u53e6\u4e00\u4e2a\u540d\u79f0=\u627e\u5230\u540c\u540d\u7684Minecraft\u7248\u672c\uff0c\u8bf7\u6362\u7528\u53e6\u4e00\u4e2a\u540d\u79f0
\u8bf7\u8f93\u5165\u8be5\u65e7\u7248\u672c\u7684\u540d\u79f0=\u8bf7\u8f93\u5165\u8be5\u65e7\u7248\u672c\u7684\u540d\u79f0
\u627e\u4e0d\u5230MINECRAFT.JAR=\u627e\u4e0d\u5230minecraft.jar
\u9009\u62e9MINECRAFT\u8def\u5f84=\u9009\u62e9Minecraft\u8def\u5f84
\u542f\u52a8\u5931\u8d25=\u542f\u52a8\u5931\u8d25
\u590d\u5236\u914d\u7f6e\u6587\u4ef6\u5931\u8d25\:\ =\u590d\u5236\u914d\u7f6e\u6587\u4ef6\u5931\u8d25:
\u590d\u5236\u6838\u5fc3\u6a21\u7ec4\u5931\u8d25\:\ =\u590d\u5236\u6838\u5fc3\u6a21\u7ec4\u5931\u8d25:
\u590d\u5236\u666e\u901a\u6a21\u7ec4\u5931\u8d25\:\ =\u590d\u5236\u666e\u901a\u6a21\u7ec4\u5931\u8d25:
\u4e0b\u8f7d\u7f3a\u5931\u5e93\uff1a{0}=\u4e0b\u8f7d\u7f3a\u5931\u5e93\uff1a{0}
\u6ca1\u6709\u9009\u62e9\u4efb\u4f55\u4e00\u4e2aMINECRAFT\u7248\u672c=\u6ca1\u6709\u9009\u62e9\u4efb\u4f55\u4e00\u4e2aMinecraft\u7248\u672c
\u9519\u8bef\u7684MINECRAFT\u8def\u5f84=\u9519\u8bef\u7684Minecraft\u8def\u5f84
\u5173\u4e8e=\u5173\u4e8e
\u4e0b\u8f7d=\u4e0b\u8f7d
\u5bc6\u7801=\u5bc6\u7801
\u624b\u52a8\u8bbe\u7f6e=\u624b\u52a8\u8bbe\u7f6e
\u4e0d\u9650\u5236=\u4e0d\u9650\u5236
32\u4f4d=32\u4f4d
64\u4f4d=64\u4f4d
\u542f\u52a8\u6a21\u5f0f=\u542f\u52a8\u6a21\u5f0f
\u6700\u5927\u5185\u5b58=\u6700\u5927\u5185\u5b58
\u6e38\u620f\u540d\u79f0=\u540d\u5b57
\u6e38\u620f\u8def\u5f84=\u6e38\u620f\u8def\u5f84
\u5bfc\u5165\u6587\u4ef6\u5939=\u5bfc\u5165\u6587\u4ef6\u5939
\u65b0\u5efa=\u65b0\u5efa
\u5220\u9664=\u5220\u9664
\u7f16\u8f91=\u7f16\u8f91
\u590d\u5236=\u590d\u5236
\u5bfc\u5165\u65e7\u7248\u672c=\u5bfc\u5165\u65e7\u7248\u672c
\u5236\u4f5c\u4e00\u952e\u542f\u52a8=\u5236\u4f5c\u4e00\u952e\u542f\u52a8
\u51c6\u5907\u4e2d=\u51c6\u5907\u4e2d
\u5f00\u59cbMINECRAFT\u4e4b\u65c5!=\u5f00\u59cbMinecraft\u4e4b\u65c5!
\u5237\u65b0=\u5237\u65b0
public_settings=\u5168\u5c40\u8bbe\u7f6e
game_download=\u6e38\u620f\u4e0b\u8f7d
\u8bbe\u7f6e\u5931\u8d25\uff1a=\u8bbe\u7f6e\u5931\u8d25\uff1a
\u7f3a\u5931\u5e93\u4e0b\u8f7d=\u7f3a\u5931\u5e93\u4e0b\u8f7d
\u9009\u62e9\u80cc\u666f\u8def\u5f84=\u9009\u62e9\u80cc\u666f\u8def\u5f84
MineLogin0=\u7f51\u7edc\u9519\u8bef
MineLogin1=\u7528\u6237\u540d\u6216\u5bc6\u7801\u4e0d\u5408\u6cd5
MineLogin2=\u5185\u90e8\u9519\u8bef
MineLogin3=\u7528\u6237\u4e0d\u5b58\u5728
MineLogin4=\u9700\u8981\u9a8c\u8bc1
MineLogin5=\u5bc6\u7801\u9519\u8bef
ForgeMod=Forge mod
ModLoaderMod=ModLoader mod
Forge=Forge
ModLoader=ModLoader
Unknown=\u672a\u77e5
Mods\u6587\u4ef6\u5939=Mods\u6587\u4ef6\u5939
Coremods\u6587\u4ef6\u5939=Coremods\u6587\u4ef6\u5939
Mod\u72ec\u7acb\u6587\u4ef6\u5939=Mod\u72ec\u7acb\u6587\u4ef6\u5939
\u914d\u7f6e\u6587\u4ef6\u5939=\u914d\u7f6e\u6587\u4ef6\u5939
\u767b\u5f55\u5931\u8d25\uff1a=\u767b\u5f55\u5931\u8d25\uff1a
\u9009\u62e9\u5931\u8d25=\u9009\u62e9\u5931\u8d25
\u63d2\u4ef6\u9519\u8bef\uff1a=\u63d2\u4ef6\u9519\u8bef\uff1a
\u767b\u5f55\u5931\u8d25\uff1a=\u767b\u5f55\u5931\u8d25\uff1a
\u6ca1\u6709\u767b\u5165\u65b9\u5f0f...=\u6ca1\u6709\u767b\u5165\u65b9\u5f0f...
\u4fdd\u5b58=\u4fdd\u5b58
\u767b\u5f55\u6a21\u5f0f=\u767b\u5f55\u6a21\u5f0f
\u7248\u672c\u7f16\u8f91=\u7248\u672c\u7f16\u8f91
\u7248\u672c\u53f7=\u7248\u672c\u53f7
\u5bfc\u5165=\u5bfc\u5165
\u64cd\u4f5c=\u64cd\u4f5c
\u4e0b\u8f7d\u4fe1\u606f=\u4e0b\u8f7d\u4fe1\u606f
\u5b89\u88c5=\u5b89\u88c5
\u6dfb\u52a0=\u6dfb\u52a0
\u5168\u90e8\u4e0b\u8f7d=\u5168\u90e8\u4e0b\u8f7d
\u52a0\u5165MINECRAFT.JAR=\u52a0\u5165minecraft.jar
\u7ba1\u7406=\u7ba1\u7406
\u52a8\u6001\u52a0\u8f7d\u6a21\u7ec4=\u52a8\u6001\u52a0\u8f7d\u6a21\u7ec4
\u5e93=\u5e93
AdvancedSettings=\u9ad8\u7ea7\u8bbe\u7f6e
\u6700\u5927\u5316=\u6700\u5927\u5316
\u68c0\u67e5\u66f4\u65b0=\u68c0\u67e5\u66f4\u65b0
\u67e5\u770b\u65e5\u5fd7=\u67e5\u770b\u65e5\u5fd7
\u80cc\u666f\u5730\u5740=\u80cc\u666f\u5730\u5740
UNEXPECTED\ EXCEPTION\ LOADING\ =Unexpected exception loading
\u5f53\u524d\u662f\u6700\u65b0\u7248\u672c=\u5f53\u524d\u662f\u6700\u65b0\u7248\u672c
\u65e0\u6cd5\u6253\u5f00\u6d4f\u89c8\u5668\uff0c\u7f51\u5740\u5df2\u7ecf\u590d\u5236\u5230\u526a\u8d34\u677f\u4e86\uff0c\u60a8\u53ef\u4ee5\u624b\u52a8\u7c98\u8d34\u7f51\u5740\u6253\u5f00\u9875\u9762=\u65e0\u6cd5\u6253\u5f00\u6d4f\u89c8\u5668\uff0c\u7f51\u5740\u5df2\u7ecf\u590d\u5236\u5230\u526a\u8d34\u677f\u4e86\uff0c\u60a8\u53ef\u4ee5\u624b\u52a8\u7c98\u8d34\u7f51\u5740\u6253\u5f00\u9875\u9762
\u662f\u5426\u524d\u5f80\u53d1\u5e03\u9875\u9762\u66f4\u65b0\uff1f=\u662f\u5426\u524d\u5f80\u53d1\u5e03\u9875\u9762\u66f4\u65b0\uff1f
\u66f4\u65b0\u4fe1\u606f\u4e3a\:\ =\u66f4\u65b0\u4fe1\u606f\u4e3a:
\u6700\u65b0\u7248\u672c\u4e3a\uff1a=\u6700\u65b0\u7248\u672c\u4e3a\uff1a
\u68c0\u67e5\u66f4\u65b0\u5931\u8d25=\u68c0\u67e5\u66f4\u65b0\u5931\u8d25
\u8fde\u63a5\u4e2d=\u8fde\u63a5\u4e2d
\u83b7\u53d6\u5217\u8868\u5931\u8d25\uff0c\u8bf7\u5237\u65b0\u91cd\u8bd5=\u83b7\u53d6\u5217\u8868\u5931\u8d25\uff0c\u8bf7\u5237\u65b0\u91cd\u8bd5
INVALID\ PLUGIN=Invalid plugin
\u65e0\u6cd5\u8fde\u63a5=\u65e0\u6cd5\u8fde\u63a5
\ \u5dee\ ORANGERED=\ \u5dee orangered
\ \u8f83\u5dee\ ORANGE=\ \u8f83\u5dee orange
\ \u4e2d\ YELLOGREEN=\ \u4e2d yellogreen
\ \u8f83\u597d\ BLUE=\ \u8f83\u597d blue
\ \u597d\ GREEN=\ \u597d green
\u670d\u52a1\u5668{0}\u7684\u56de\u590d\u65e0\u6548=\u670d\u52a1\u5668{0}\u7684\u56de\u590d\u65e0\u6548
\u63a5\u4e0b\u6765\u5f39\u51fa\u6765\u7684\u7a97\u53e3\u91cc\u8bf7\u9009\u62e9\u8def\u5f84\u4e3a\u6e38\u620f\u8def\u5f84\u3002\u7a0b\u5e8f\u5df2\u7ecf\u5c06\u76ee\u5f55\u590d\u5236\u5230\u4e86\u526a\u8d34\u677f\uff0c\u76f4\u63a5\u5728\u7a97\u53e3\u91cc\u9009\u62e9\\"...\\"\u6309\u94ae\uff0c\u7c98\u8d34\u8def\u5f84\uff0c\u786e\u5b9a\u5373\u53ef=\u63a5\u4e0b\u6765\u5f39\u51fa\u6765\u7684\u7a97\u53e3\u91cc\u8bf7\u9009\u62e9\u8def\u5f84\u4e3a\u6e38\u620f\u8def\u5f84\u3002\u7a0b\u5e8f\u5df2\u7ecf\u5c06\u76ee\u5f55\u590d\u5236\u5230\u4e86\u526a\u8d34\u677f\uff0c\u76f4\u63a5\u5728\u7a97\u53e3\u91cc\u9009\u62e9\\"...\\"\u6309\u94ae\uff0c\u7c98\u8d34\u8def\u5f84\uff0c\u786e\u5b9a\u5373\u53ef
\u65e0\u6cd5\u6253\u5f00\u8d44\u6e90\u7ba1\u7406\u5668\:\ =\u65e0\u6cd5\u6253\u5f00\u8d44\u6e90\u7ba1\u7406\u5668:
\u63d0\u793a=\u63d0\u793a
\u8f93\u5165\u65b0\u7248\u672c\u540d\u79f0=\u8f93\u5165\u65b0\u7248\u672c\u540d\u79f0
\u540d\u79f0=\u540d\u79f0
\u4fdd\u5b58\u5931\u8d25=\u4fdd\u5b58\u5931\u8d25
\u4fdd\u5b58\u538b\u7f29\u5305\u5230=\u4fdd\u5b58\u538b\u7f29\u5305\u5230
\u9009\u62e9\u6750\u8d28\u5305=\u9009\u62e9\u6750\u8d28\u5305
\u9009\u62e9\u8d44\u6e90\u5305=\u9009\u62e9\u8d44\u6e90\u5305
\u9009\u62e9\u5e93/\u6a21\u7ec4=\u9009\u62e9\u5e93/\u6a21\u7ec4
\u6ca1\u6709\u9009\u4e2d\u4efb\u4f55\u4e00\u4e2a\u5e93/\u6a21\u7ec4\u3002=\u6ca1\u6709\u9009\u4e2d\u4efb\u4f55\u4e00\u4e2a\u5e93/\u6a21\u7ec4\u3002
\u5220\u9664\u5931\u8d25=\u5220\u9664\u5931\u8d25
\u6dfb\u52a0\u5931\u8d25=\u6dfb\u52a0\u5931\u8d25
\u9009\u62e9\u6a21\u7ec4=\u9009\u62e9\u6a21\u7ec4
\u7248\u672c\u540d\u79f0\u4e0d\u80fd\u4e3a\u7a7a=\u7248\u672c\u540d\u79f0\u4e0d\u80fd\u4e3a\u7a7a
\u5907\u4efd\u5230=\u5907\u4efd\u5230
\u662fCOREODS\u6587\u4ef6\u5939\u5185\u7684\u6240\u6709\u6838\u5fc3\u6a21\u7ec4=\u662fCoremods\u6587\u4ef6\u5939\u5185\u7684\u6240\u6709\u6838\u5fc3\u6a21\u7ec4
\u662fMODS\u6587\u4ef6\u5939\u5185\u7684\u6240\u6709\u6a21\u7ec4=\u662fMods\u6587\u4ef6\u5939\u5185\u7684\u6240\u6709\u6a21\u7ec4
\u901a\u5e38\u662f\u6a21\u7ec4=\u901a\u5e38\u662f\u6a21\u7ec4
\u4e0b\u79fb=\u4e0b\u79fb
\u4e0a\u79fb=\u4e0a\u79fb
\u5220\u9664=\u5220\u9664
\u589e\u52a0=\u589e\u52a0
\u901a\u5e38\u662fFORGE,MODLOADER\u4ee5\u53caMINECRAFT\u6240\u4f9d\u8d56\u7684\u5e93=\u901a\u5e38\u662fForge,Modloader\u4ee5\u53caMinecraft\u6240\u4f9d\u8d56\u7684\u5e93
\u9644\u52a0\u542f\u52a8\u53c2\u6570=\u9644\u52a0\u542f\u52a8\u53c2\u6570
\u81ea\u5b9a\u4e49\u5e93\u6587\u4ef6\u5939(LIBRARIES\u6587\u4ef6\u5939)=\u81ea\u5b9a\u4e49\u5e93\u6587\u4ef6\u5939(libraries\u6587\u4ef6\u5939)
\u4e3b\u7c7b=\u4e3b\u7c7b
\u81ea\u5b9a\u4e49\u8d44\u6e90\u6587\u4ef6\u5939(ASSETS\u6587\u4ef6\u5939)=\u81ea\u5b9a\u4e49\u8d44\u6e90\u6587\u4ef6\u5939(assets\u6587\u4ef6\u5939)
\u624b\u52a8\u8bbe\u7f6e=\u624b\u52a8\u8bbe\u7f6e
\u4e0d\u5f3a\u5236=\u4e0d\u5f3a\u5236
32\u4f4d=32\u4f4d
64\u4f4d=64\u4f4d
\u542f\u52a8\u6a21\u5f0f=\u542f\u52a8\u6a21\u5f0f
\u73a9\u5bb6\u540d=\u73a9\u5bb6\u540d
1.6\u53ca\u4ee5\u4e0a\u7248\u672c\u4ee5\u53ca\u5bfc\u5165\u7684\u65e7\u7248\u672c=1.6\u53ca\u4ee5\u4e0a\u7248\u672c\u4ee5\u53ca\u5bfc\u5165\u7684\u65e7\u7248\u672c
\u6700\u5927\u5185\u5b58=\u6700\u5927\u5185\u5b58
JAVA\u865a\u62df\u673a\u53c2\u6570=Java\u865a\u62df\u673a\u53c2\u6570
JAVA\u8def\u5f84=Java\u8def\u5f84
\u5168\u5c4f=\u5168\u5c4f
\u5206\u8fa8\u7387=\u5206\u8fa8\u7387
\u6e38\u620f\u8def\u5f84=\u6e38\u620f\u8def\u5f84
\u4ee5\u4e0b\u8bbe\u7f6e\u5b57\u6bb5\u4e3a\u7a7a\u4ee3\u8868\u7740\u4f7f\u7528\u9ed8\u8ba4\u8bbe\u7f6e=\u9664\u540d\u79f0\u4ee5\u4e0b\u5b57\u6bb5\u53ef\u4ee5\u4e0d\u586b
\u53d6\u6d88=\u53d6\u6d88
\u786e\u5b9a=\u786e\u5b9a
game_download=\u6e38\u620f\u4e0b\u8f7d
public_settings=\u5168\u5c40\u8bbe\u7f6e
invalid=\u65e0\u6548\u7684
invalid_jar=\u65e0\u6548\u7684jar\u5305
not_a_file=\u4e0d\u662f\u6587\u4ef6
not_found=\u627e\u4e0d\u5230minecraft.jar
not_readable=minecraft.jar\u4e0d\u53ef\u8bfb
modified=(\u4fee\u6539\u7684!)
\u83b7\u53d6\u4e2d=\u83b7\u53d6\u4e2d
\u63d2\u4ef6\u9519\u8bef=\u63d2\u4ef6\u9519\u8bef
CannotLoadPluginsBecauseOfAnError=\u65e0\u6cd5\u52a0\u8f7d\u63d2\u4ef6\uff0c\u56e0\u4e3a\u53d1\u751f\u4e86\u4e00\u4e2a\u9519\u8bef\u3002
CRASH\ REPORT\ DETECTED,\ BUT\ UNKNOWN\ FORMAT\:=Crash report detected, but unknown format:
COULDN'T\ OPEN\ CRASH\ REPORT=Couldn't open crash report
CRASH\ REPORT\ DETECTED,\ OPENING\:=Crash report detected, opening:
MinecraftCrashed=Minecraft\u5d29\u6e83\u4e86\uff01(\u9519\u8bef\u4ee3\u7801:{0})
RememberMe=\u8bb0\u4f4f\u6211
Logout=\u767b\u51fa
ShowIfIsLoaded=\u663e\u793a\u63d2\u4ef6\u662f\u5426\u52a0\u8f7d\uff0c\u70b9\u51fb\u67e5\u770b\u9519\u8bef
IsLoaded=\u662f\u5426\u52a0\u8f7d
PluginSettings=\u63d2\u4ef6\u8bbe\u7f6e
Details=\u4fe1\u606f
Authors=\u4f5c\u8005
Version=\u7248\u672c
Name=\u540d\u79f0
CheckUpdate=\u68c0\u67e5\u672c\u542f\u52a8\u5668\u7684\u66f4\u65b0
DownloadSource=\u4e0b\u8f7d\u6e90
DisableMoveMods=\u7981\u6b62\u7248\u672c\u81ea\u6709\u6a21\u7ec4\uff08\u79fb\u52a8\u6a21\u7ec4\uff09\u529f\u80fd
ShowConsoleOutput=\u5c31\u662fMinecraft\u7684\u63a7\u5236\u53f0\u8f93\u51fa
MinecraftLocation=Minecraft\u8def\u5f84\uff08\u5373.minecraft\u6587\u4ef6\u5939\uff09
MaxMemoryTooltip=\u5141\u8bb8Minecraft\u6700\u591a\u5141\u8bb8\u4f7f\u7528\u7684\u5185\u5b58\uff08\u770b\u4e0d\u61c2\u5c31\u4f7f\u7528\u9ed8\u8ba4\u76841024\u5427\uff09
FailedToLoad=\u52a0\u8f7d\u5931\u8d25
Loaded=\u5df2\u52a0\u8f7d
NoCharacter=\u8be5\u5e10\u53f7\u6ca1\u6709\u89d2\u8272
LegacyLogin=\u65e7\u7248\u6b63\u7248\u767b\u5f55
YggdrasilLogin=\u65b0\u7248\u6b63\u7248\u767b\u5f55
PleaseChooseCharacter=\u8bf7\u9009\u62e9\u60a8\u8981\u4f7f\u7528\u7684\u89d2\u8272
WrongPassword=\u53ef\u80fd\u662f\u60a8\u7684\u7528\u6237\u540d\u6216\u5bc6\u7801\u9519\u8bef
OfflineLogin=\u79bb\u7ebf\u6a21\u5f0f
GameDownload=\u6e38\u620f\u4e0b\u8f7d
IntegrateDownload=\u6574\u5408\u5305\u4e0b\u8f7d
AssetsDownload=\u8d44\u6e90\u4e0b\u8f7d
Installers=\u81ea\u52a8\u5b89\u88c5
WorldSaving=\u5907\u4efd\u5730\u56fe
ServerEditor=\u670d\u52a1\u5668\u7f16\u8f91
TexturepackEditor=\u6750\u8d28\u5305\u7ba1\u7406
Refresh=\u5237\u65b0\u5217\u8868
Install=\u5b89\u88c5
AssetsType=\u8d44\u6e90\u7c7b\u578b
InstallOptifine=\u5b89\u88c5\u9009\u4e2d\u7684Optifine
Changelog=\u66f4\u65b0\u4fe1\u606f
InstallForge=\u5b89\u88c5\u9009\u4e2d\u7684Forge
ModManaging=\u6a21\u7ec4\u7ba1\u7406
PluginCenter=\u63d2\u4ef6\u4e2d\u5fc3
ExtMods=\u5916\u90e8\u6a21\u7ec4
CoreMods=\u6838\u5fc3\u6a21\u7ec4
NormalSettings=\u666e\u901a\u8bbe\u7f6e
1.6AndAbove=1.6\u53ca\u4ee5\u4e0a
1.5AndBelow=1.5\u53ca\u4ee5\u4e0b
IsActive=\u6d3b\u52a8
Location=\u8def\u5f84
Type=\u7c7b\u578b
ReleaseTime=\u91ca\u653e\u65f6\u95f4
Time=\u53d1\u5e03\u65f6\u95f4
Version=\u7248\u672c
MCVersion=MC\u7248\u672c
IntegrateName=\u6574\u5408\u5305\u540d\u79f0
IntegrateVersion=\u6574\u5408\u5305\u7248\u672c
ServerName=\u670d\u52a1\u5668\u540d\u79f0
HideAddress=\u9690\u85cf\u5730\u5740
Address=\u5730\u5740
Introduction=\u4ecb\u7ecd
Online=\u5728\u7ebf
Delay=\u5ef6\u8fdf
Clear=\u6e05\u9664
Close=\u5173\u95ed
Save=\u4fdd\u5b58
JoinMinecraftJar=\u52a0\u5165minecraft.jar
ExternalMods=\u5916\u90e8\u6a21\u7ec4
DynamicLoadingMods=\u52a8\u6001\u52a0\u8f7d\u6a21\u7ec4
Libraries=\u5e93
TagArguments=\u9644\u52a0\u7ed9\u4e88Minecraft\u7684\u53c2\u6570
MainClass=Minecraft\u7684\u4e3b\u7c7b\uff08\u4e0d\u77e5\u9053\u4ec0\u4e48\u610f\u601d\u7684\u8bdd\u4e5f\u5c31\u7528\u4e0d\u4e0a\u4e86\uff09
DefaultLibrariesFolder=\u9ed8\u8ba4\u4e3a.minecraft/libraries\u6587\u4ef6\u5939
DefaultAssetsFolder=\u9ed8\u8ba4\u4e3a.minecraft/assets\u6587\u4ef6\u5939
MakeMCMaximum=\u4f7fMinecraft\u7a97\u53e3\u6700\u5927\u5316
MCFolderFormat=\u5c31\u662fMinecraft\u6587\u4ef6\u5939\u683c\u5f0f
MakeMCFullscreen=\u4f7fMinecraft\u7a97\u53e3\u5168\u5c4f
MCHeight=Minecraft\u7a97\u53e3\u9ad8
MCWidth=Minecraft\u7a97\u53e3\u5bbd
Personalization=\u4e2a\u6027\u5316
MaxPermGen=\u6700\u5927\u6c38\u4e45\u4fdd\u5b58\u533a\u57df\uff08MB\uff09
@@ -0,0 +1,236 @@
# To change this template, choose Tools | Templates
# and open the template in the editor.
\u6e38\u620f\u7248\u672c=\u904a\u6232\u7248\u672c
\u8fd9\u4e2aMINECRAFT\u6587\u4ef6\u5939\u65e2\u4e0d\u662f1.6\u7248\u4e5f\u4e0d\u662f\u65e7\u7248\u7684\u600e\u4e48\u5bfc\u5165\u561b0V0\u3002=\u9019\u500bminecraft\u8cc7\u6599\u593e\u65e2\u4e0d\u662f1.6\u7248\u4e5f\u4e0d\u662f\u820a\u7248\u7684\u600e\u9ebc\u5c0e\u5165\u561b0v0\u3002
\u672a\u9009\u4e2d\u4efb\u4f55\u4e00\u4e2a\u7248\u672c=\u672a\u9078\u4e2d\u4efb\u4f55\u4e00\u500b\u7248\u672c
\u5bfc\u5165\u5931\u8d25\:\ {0}=\u5c0e\u5165\u5931\u6557: {0}
\u627e\u5230\u540c\u540d\u7684MINECRAFT\u7248\u672c\uff0c\u8bf7\u6362\u7528\u53e6\u4e00\u4e2a\u540d\u79f0=\u627e\u5230\u540c\u540d\u7684Minecraft\u7248\u672c\uff0c\u8acb\u63db\u7528\u53e6\u4e00\u500b\u540d\u7a31
\u8bf7\u8f93\u5165\u8be5\u65e7\u7248\u672c\u7684\u540d\u79f0=\u8acb\u8f38\u5165\u8a72\u820a\u7248\u672c\u7684\u540d\u7a31
\u627e\u4e0d\u5230MINECRAFT.JAR=\u627e\u4e0d\u5230minecraft.jar
\u9009\u62e9MINECRAFT\u8def\u5f84=\u9078\u64c7Minecraft\u8def\u5f91
\u542f\u52a8\u5931\u8d25=\u555f\u52d5\u5931\u6557
\u590d\u5236\u914d\u7f6e\u6587\u4ef6\u5931\u8d25\:\ =\u8907\u88fd\u914d\u7f6e\u6587\u4ef6\u5931\u6557:
\u590d\u5236\u6838\u5fc3\u6a21\u7ec4\u5931\u8d25\:\ =\u8907\u88fd\u6838\u5fc3\u6a21\u7d44\u5931\u6557:
\u590d\u5236\u666e\u901a\u6a21\u7ec4\u5931\u8d25\:\ =\u8907\u88fd\u666e\u901a\u6a21\u7d44\u5931\u6557:
\u4e0b\u8f7d\u7f3a\u5931\u5e93\uff1a{0}=\u4e0b\u8f09\u7f3a\u5931\u5eab\uff1a{0}
\u6ca1\u6709\u9009\u62e9\u4efb\u4f55\u4e00\u4e2aMINECRAFT\u7248\u672c=\u6c92\u6709\u9078\u64c7\u4efb\u4f55\u4e00\u500bMinecraft\u7248\u672c
\u9519\u8bef\u7684MINECRAFT\u8def\u5f84=\u932f\u8aa4\u7684Minecraft\u8def\u5f91
\u5173\u4e8e=\u5173\u4e8e
\u4e0b\u8f7d=\u4e0b\u8f09
\u5bc6\u7801=\u5bc6\u78bc
\u624b\u52a8\u8bbe\u7f6e=\u624b\u52d5\u8a2d\u5b9a
\u4e0d\u9650\u5236=\u4e0d\u9650\u5236
32\u4f4d=32\u4f4d
64\u4f4d=64\u4f4d
\u542f\u52a8\u6a21\u5f0f=\u555f\u52d5\u6a21\u5f0f
\u6700\u5927\u5185\u5b58=\u6700\u5927\u5167\u5b58
\u6e38\u620f\u540d\u79f0=\u904a\u6232\u540d\u7a31
\u6e38\u620f\u8def\u5f84=\u904a\u6232\u8def\u5f91
\u5bfc\u5165\u6587\u4ef6\u5939=\u5c0e\u5165\u8cc7\u6599\u593e
\u65b0\u5efa=\u65b0\u5efa
\u5220\u9664=\u522a\u9664
\u7f16\u8f91=\u7de8\u8f2f
\u590d\u5236=\u8907\u88fd
\u5bfc\u5165\u65e7\u7248\u672c=\u5c0e\u5165\u820a\u7248\u672c
\u5236\u4f5c\u4e00\u952e\u542f\u52a8=\u88fd\u4f5c\u4e00\u9375\u555f\u52d5
\u51c6\u5907\u4e2d=\u51c6\u5907\u4e2d
\u5f00\u59cbMINECRAFT\u4e4b\u65c5!=\u958b\u59cbMinecraft\u4e4b\u65c5!
\u5237\u65b0=\u5237\u65b0
public_settings=\u5168\u5c40\u8a2d\u5b9a
game_download=\u904a\u6232\u4e0b\u8f09
\u8bbe\u7f6e\u5931\u8d25\uff1a=\u8a2d\u5b9a\u5931\u6557\uff1a
\u7f3a\u5931\u5e93\u4e0b\u8f7d=\u7f3a\u5931\u5eab\u4e0b\u8f09
\u9009\u62e9\u80cc\u666f\u8def\u5f84=\u9078\u64c7\u80cc\u666f\u8def\u5f91
MineLogin0=\u7db2\u7d61\u932f\u8aa4
MineLogin1=\u7528\u6236\u540d\u6216\u5bc6\u78bc\u4e0d\u5408\u6cd5
MineLogin2=\u5167\u90e8\u932f\u8aa4
MineLogin3=\u7528\u6236\u4e0d\u5b58\u5728
MineLogin4=\u9700\u8981\u9a57\u8b49
MineLogin5=\u5bc6\u78bc\u932f\u8aa4
ForgeMod=Forge mod
ModLoaderMod=ModLoader mod
Forge=Forge
ModLoader=ModLoader
Unknown=\u672a\u77e5
Mods\u6587\u4ef6\u5939=Mods\u8cc7\u6599\u593e
Coremods\u6587\u4ef6\u5939=Coremods\u8cc7\u6599\u593e
Mod\u72ec\u7acb\u6587\u4ef6\u5939=Mod\u72ec\u7acb\u8cc7\u6599\u593e
\u914d\u7f6e\u6587\u4ef6\u5939=\u914d\u7f6e\u8cc7\u6599\u593e
\u767b\u5f55\u5931\u8d25\uff1a=\u767b\u5165\u5931\u6557\uff1a
\u9009\u62e9\u5931\u8d25=\u9078\u64c7\u5931\u6557
\u63d2\u4ef6\u9519\u8bef\uff1a=\u63d2\u4ef6\u932f\u8aa4\uff1a
\u767b\u5f55\u5931\u8d25\uff1a=\u767b\u9304\u5931\u6557\uff1a
\u6ca1\u6709\u767b\u5165\u65b9\u5f0f...=\u6c92\u6709\u767b\u5165\u65b9\u5f0f...
\u4fdd\u5b58=\u4fdd\u5b58
\u767b\u5f55\u6a21\u5f0f=\u767b\u5165\u6a21\u5f0f
\u7248\u672c\u7f16\u8f91=\u7248\u672c\u7de8\u8f2f
\u7248\u672c\u53f7=\u7248\u672c\u865f
\u5bfc\u5165=\u5c0e\u5165
\u64cd\u4f5c=\u64cd\u4f5c
\u4e0b\u8f7d\u4fe1\u606f=\u4e0b\u8f09\u4fe1\u606f
\u5b89\u88c5=\u5b89\u88c5
\u6dfb\u52a0=\u6dfb\u52a0
\u5168\u90e8\u4e0b\u8f7d=\u5168\u90e8\u4e0b\u8f09
\u52a0\u5165MINECRAFT.JAR=\u52a0\u5165minecraft.jar
\u7ba1\u7406=\u7ba1\u7406
\u52a8\u6001\u52a0\u8f7d\u6a21\u7ec4=\u52d5\u614b\u52a0\u8f09\u6a21\u7d44
\u5e93=\u5eab
AdvancedSettings=\u9ad8\u7d1a\u8a2d\u7f6e
\u6700\u5927\u5316=\u6700\u5927\u5316
\u68c0\u67e5\u66f4\u65b0=\u6aa2\u67e5\u66f4\u65b0
\u67e5\u770b\u65e5\u5fd7=\u67e5\u770b\u65e5\u8a8c
\u80cc\u666f\u5730\u5740=\u80cc\u666f\u5730\u5740
UNEXPECTED\ EXCEPTION\ LOADING\ =\u610f\u5916\u7684\u7570\u5e38
\u5f53\u524d\u662f\u6700\u65b0\u7248\u672c=\u7576\u524d\u662f\u6700\u65b0\u7248\u672c
\u65e0\u6cd5\u6253\u5f00\u6d4f\u89c8\u5668\uff0c\u7f51\u5740\u5df2\u7ecf\u590d\u5236\u5230\u526a\u8d34\u677f\u4e86\uff0c\u60a8\u53ef\u4ee5\u624b\u52a8\u7c98\u8d34\u7f51\u5740\u6253\u5f00\u9875\u9762=\u7121\u6cd5\u6253\u958b\u700f\u89bd\u5668\uff0c\u7db2\u5740\u5df2\u7d93\u5fa9\u88fd\u5230\u526a\u8cbc\u677f\u4e86\uff0c\u60a8\u53ef\u4ee5\u624b\u52d5\u7c98\u8cbc\u7db2\u5740\u6253\u958b\u9801\u9762
\u662f\u5426\u524d\u5f80\u53d1\u5e03\u9875\u9762\u66f4\u65b0\uff1f=\u662f\u5426\u524d\u5f80\u767c\u5e03\u9801\u9762\u66f4\u65b0\uff1f
\u66f4\u65b0\u4fe1\u606f\u4e3a\:\ =\u66f4\u65b0\u4fe1\u606f\u70ba:
\u6700\u65b0\u7248\u672c\u4e3a\uff1a=\u6700\u65b0\u7248\u672c\u70ba\uff1a
\u68c0\u67e5\u66f4\u65b0\u5931\u8d25=\u6aa2\u67e5\u66f4\u65b0\u5931\u6557
\u8fde\u63a5\u4e2d=\u9023\u63a5\u4e2d
\u83b7\u53d6\u5217\u8868\u5931\u8d25\uff0c\u8bf7\u5237\u65b0\u91cd\u8bd5=\u7372\u53d6\u5217\u8868\u5931\u6557\uff0c\u8acb\u5237\u65b0\u91cd\u8a66
INVALID\ PLUGIN=\u7121\u6548\u63d2\u4ef6
\u65e0\u6cd5\u8fde\u63a5=\u7121\u6cd5\u9023\u63a5
\ \u5dee\ ORANGERED=\ \u5dee orangered
\ \u8f83\u5dee\ ORANGE=\ \u8f03\u5dee orange
\ \u4e2d\ YELLOGREEN=\ \u4e2d yellogreen
\ \u8f83\u597d\ BLUE=\ \u8f03\u597d blue
\ \u597d\ GREEN=\ \u597d green
\u670d\u52a1\u5668{0}\u7684\u56de\u590d\u65e0\u6548=\u670d\u52d9\u5668{0}\u7684\u56de\u590d\u7121\u6548
\u63a5\u4e0b\u6765\u5f39\u51fa\u6765\u7684\u7a97\u53e3\u91cc\u8bf7\u9009\u62e9\u8def\u5f84\u4e3a\u6e38\u620f\u8def\u5f84\u3002\u7a0b\u5e8f\u5df2\u7ecf\u5c06\u76ee\u5f55\u590d\u5236\u5230\u4e86\u526a\u8d34\u677f\uff0c\u76f4\u63a5\u5728\u7a97\u53e3\u91cc\u9009\u62e9\\"...\\"\u6309\u94ae\uff0c\u7c98\u8d34\u8def\u5f84\uff0c\u786e\u5b9a\u5373\u53ef=\u63a5\u4e0b\u4f86\u5f48\u51fa\u4f86\u7684\u7a97\u53e3\u88e1\u8acb\u9078\u64c7\u8def\u5f91\u70ba\u904a\u6232\u8def\u5f91\u3002\u7a0b\u5e8f\u5df2\u7d93\u5c07\u76ee\u9304\u8907\u88fd\u5230\u4e86\u526a\u8cbc\u677f\uff0c\u76f4\u63a5\u5728\u7a97\u53e3\u88e1\u9078\u64c7\\"...\\"\u6309\u9215\uff0c\u7c98\u8cbc\u8def\u5f91\uff0c\u78ba\u5b9a\u5373\u53ef
\u65e0\u6cd5\u6253\u5f00\u8d44\u6e90\u7ba1\u7406\u5668\:\ =\u7121\u6cd5\u6253\u958b\u8cc7\u6e90\u7ba1\u7406\u5668:
\u63d0\u793a=\u63d0\u793a
\u8f93\u5165\u65b0\u7248\u672c\u540d\u79f0=\u8f38\u5165\u65b0\u7248\u672c\u540d\u7a31
\u540d\u79f0=\u540d\u7a31
\u4fdd\u5b58\u5931\u8d25=\u4fdd\u5b58\u5931\u6557
\u4fdd\u5b58\u538b\u7f29\u5305\u5230=\u4fdd\u5b58\u58d3\u7e2e\u5305\u5230
\u9009\u62e9\u6750\u8d28\u5305=\u9078\u64c7\u6750\u8cea\u5305
\u9009\u62e9\u8d44\u6e90\u5305=\u9078\u64c7\u8cc7\u6e90\u5305
\u9009\u62e9\u5e93/\u6a21\u7ec4=\u9078\u64c7\u5eab/\u6a21\u7d44
\u6ca1\u6709\u9009\u4e2d\u4efb\u4f55\u4e00\u4e2a\u5e93/\u6a21\u7ec4\u3002=\u6c92\u6709\u9078\u4e2d\u4efb\u4f55\u4e00\u500b\u5eab/\u6a21\u7d44\u3002
\u5220\u9664\u5931\u8d25=\u522a\u9664\u5931\u6557
\u6dfb\u52a0\u5931\u8d25=\u6dfb\u52a0\u5931\u6557
\u9009\u62e9\u6a21\u7ec4=\u9078\u64c7\u6a21\u7d44
\u7248\u672c\u540d\u79f0\u4e0d\u80fd\u4e3a\u7a7a=\u7248\u672c\u540d\u7a31\u4e0d\u80fd\u70ba\u7a7a
\u5907\u4efd\u5230=\u5099\u4efd\u5230
\u662fCOREODS\u6587\u4ef6\u5939\u5185\u7684\u6240\u6709\u6838\u5fc3\u6a21\u7ec4=\u662fCoremods\u6587\u4ef6\u593e\u5167\u7684\u6240\u6709\u6838\u5fc3\u6a21\u7d44
\u662fMODS\u6587\u4ef6\u5939\u5185\u7684\u6240\u6709\u6a21\u7ec4=\u662fMods\u6587\u4ef6\u593e\u5167\u7684\u6240\u6709\u6a21\u7d44
\u901a\u5e38\u662f\u6a21\u7ec4=\u901a\u5e38\u662f\u6a21\u7d44
\u4e0b\u79fb=\u4e0b\u79fb
\u4e0a\u79fb=\u4e0a\u79fb
\u5220\u9664=\u522a\u9664
\u589e\u52a0=\u589e\u52a0
\u901a\u5e38\u662fFORGE,MODLOADER\u4ee5\u53caMINECRAFT\u6240\u4f9d\u8d56\u7684\u5e93=\u901a\u5e38\u662fForge,Modloader\u4ee5\u53caMinecraft\u6240\u4f9d\u8cf4\u7684\u5eab
\u9644\u52a0\u542f\u52a8\u53c2\u6570=\u9644\u52a0\u555f\u52d5\u53c3\u6578
\u81ea\u5b9a\u4e49\u5e93\u6587\u4ef6\u5939(LIBRARIES\u6587\u4ef6\u5939)=\u81ea\u5b9a\u7fa9\u5eab\u8cc7\u6599\u593e(libraries\u8cc7\u6599\u593e)
\u4e3b\u7c7b=\u4e3b\u7c7b
\u81ea\u5b9a\u4e49\u8d44\u6e90\u6587\u4ef6\u5939(ASSETS\u6587\u4ef6\u5939)=\u81ea\u5b9a\u7fa9\u8cc7\u6e90\u8cc7\u6599\u593e(assets\u8cc7\u6599\u593e)
\u624b\u52a8\u8bbe\u7f6e=\u624b\u52d5\u8a2d\u5b9a
\u4e0d\u5f3a\u5236=\u4e0d\u5f37\u5236
32\u4f4d=32\u4f4d
64\u4f4d=64\u4f4d
\u542f\u52a8\u6a21\u5f0f=\u555f\u52d5\u6a21\u5f0f
\u73a9\u5bb6\u540d=\u73a9\u5bb6\u540d
1.6\u53ca\u4ee5\u4e0a\u7248\u672c\u4ee5\u53ca\u5bfc\u5165\u7684\u65e7\u7248\u672c=1.6\u53ca\u4ee5\u4e0a\u7248\u672c\u4ee5\u53ca\u5c0e\u5165\u7684\u820a\u7248\u672c
\u6700\u5927\u5185\u5b58=\u6700\u5927\u5167\u5b58
JAVA\u865a\u62df\u673a\u53c2\u6570=Java\u865b\u64ec\u6a5f\u53c3\u6578
JAVA\u8def\u5f84=Java\u8def\u5f91
\u5168\u5c4f=\u5168\u5c4f
\u5206\u8fa8\u7387=\u5206\u8fa8\u7387
\u6e38\u620f\u8def\u5f84=\u904a\u6232\u8def\u5f91
\u4ee5\u4e0b\u8bbe\u7f6e\u5b57\u6bb5\u4e3a\u7a7a\u4ee3\u8868\u7740\u4f7f\u7528\u9ed8\u8ba4\u8bbe\u7f6e=\u9664\u540d\u7a31\u4ee5\u4e0b\u5b57\u6bb5\u53ef\u4ee5\u4e0d\u586b
\u53d6\u6d88=\u53d6\u6d88
\u786e\u5b9a=\u78ba\u5b9a
game_download=\u904a\u6232\u4e0b\u8f09
public_settings=\u5168\u5c40\u8a2d\u5b9a
invalid=\u7121\u6548\u7684
invalid_jar=\u7121\u6548\u7684jar\u5305
not_a_file=\u4e0d\u662f\u6587\u4ef6
not_found=\u627e\u4e0d\u5230minecraft.jar
not_readable=minecraft.jar\u4e0d\u53ef\u8b80
modified=(\u4fee\u6539\u7684!)
\u83b7\u53d6\u4e2d=\u83b7\u53d6\u4e2d
\u63d2\u4ef6\u9519\u8bef=\u63d2\u4ef6\u9519\u8bef
CannotLoadPluginsBecauseOfAnError=\u65e0\u6cd5\u52a0\u8f7d\u63d2\u4ef6\uff0c\u56e0\u4e3a\u53d1\u751f\u4e86\u4e00\u4e2a\u9519\u8bef\u3002
CRASH\ REPORT\ DETECTED,\ BUT\ UNKNOWN\ FORMAT\:=Crash report detected, but unknown format:
COULDN'T\ OPEN\ CRASH\ REPORT=Couldn't open crash report
CRASH\ REPORT\ DETECTED,\ OPENING\:=Crash report detected, opening:
MinecraftCrashed=Minecraft\u5d29\u6e83\u4e86\uff01(\u9519\u8bef\u4ee3\u7801:{0})
RememberMe=\u8bb0\u4f4f\u6211
Logout=\u767b\u51fa
ShowIfIsLoaded=\u663e\u793a\u63d2\u4ef6\u662f\u5426\u52a0\u8f7d\uff0c\u70b9\u51fb\u67e5\u770b\u9519\u8bef
IsLoaded=\u662f\u5426\u52a0\u8f7d
PluginSettings=\u63d2\u4ef6\u8bbe\u7f6e
Details=\u4fe1\u606f
Authors=\u4f5c\u8005
Version=\u7248\u672c
Name=\u540d\u79f0
CheckUpdate=\u68c0\u67e5\u672c\u542f\u52a8\u5668\u7684\u66f4\u65b0
DownloadSource=\u4e0b\u8f7d\u6e90
DisableMoveMods=\u7981\u6b62\u7248\u672c\u81ea\u6709\u6a21\u7ec4\uff08\u79fb\u52a8\u6a21\u7ec4\uff09\u529f\u80fd
ShowConsoleOutput=\u5c31\u662fMinecraft\u7684\u63a7\u5236\u53f0\u8f93\u51fa
MinecraftLocation=Minecraft\u8def\u5f84\uff08\u5373.minecraft\u6587\u4ef6\u5939\uff09
MaxMemoryTooltip=\u5141\u8bb8Minecraft\u6700\u591a\u5141\u8bb8\u4f7f\u7528\u7684\u5185\u5b58\uff08\u770b\u4e0d\u61c2\u5c31\u4f7f\u7528\u9ed8\u8ba4\u76841024\u5427\uff09
FailedToLoad=\u52a0\u8f7d\u5931\u8d25
Loaded=\u5df2\u52a0\u8f7d
NoCharacter=\u8be5\u5e10\u53f7\u6ca1\u6709\u89d2\u8272
LegacyLogin=\u65e7\u7248\u6b63\u7248\u767b\u5f55
YggdrasilLogin=\u65b0\u7248\u6b63\u7248\u767b\u5f55
PleaseChooseCharacter=\u8bf7\u9009\u62e9\u60a8\u8981\u4f7f\u7528\u7684\u89d2\u8272
WrongPassword=\u53ef\u80fd\u662f\u60a8\u7684\u7528\u6237\u540d\u6216\u5bc6\u7801\u9519\u8bef
OfflineLogin=\u79bb\u7ebf\u6a21\u5f0f
GameDownload=\u6e38\u620f\u4e0b\u8f7d
IntegrateDownload=\u6574\u5408\u5305\u4e0b\u8f7d
AssetsDownload=\u8d44\u6e90\u4e0b\u8f7d
Installers=\u81ea\u52a8\u5b89\u88c5
WorldSaving=\u5907\u4efd\u5730\u56fe
ServerEditor=\u670d\u52a1\u5668\u7f16\u8f91
TexturepackEditor=\u6750\u8d28\u5305\u7ba1\u7406
Refresh=\u5237\u65b0\u5217\u8868
Install=\u5b89\u88c5
AssetsType=\u8d44\u6e90\u7c7b\u578b
InstallOptifine=\u5b89\u88c5\u9009\u4e2d\u7684Optifine
Changelog=\u66f4\u65b0\u4fe1\u606f
InstallForge=\u5b89\u88c5\u9009\u4e2d\u7684Forge
ModManaging=\u6a21\u7ec4\u7ba1\u7406
PluginCenter=\u63d2\u4ef6\u4e2d\u5fc3
ExtMods=\u5916\u90e8\u6a21\u7ec4
CoreMods=\u6838\u5fc3\u6a21\u7ec4
NormalSettings=\u666e\u901a\u8bbe\u7f6e
1.6AndAbove=1.6\u53ca\u4ee5\u4e0a
1.5AndBelow=1.5\u53ca\u4ee5\u4e0b
IsActive=\u6d3b\u52a8
Location=\u8def\u5f84
Type=\u7c7b\u578b
ReleaseTime=\u91ca\u653e\u65f6\u95f4
Time=\u53d1\u5e03\u65f6\u95f4
Version=\u7248\u672c
MCVersion=MC\u7248\u672c
IntegrateName=\u6574\u5408\u5305\u540d\u79f0
IntegrateVersion=\u6574\u5408\u5305\u7248\u672c
ServerName=\u670d\u52a1\u5668\u540d\u79f0
HideAddress=\u9690\u85cf\u5730\u5740
Address=\u5730\u5740
Introduction=\u4ecb\u7ecd
Online=\u5728\u7ebf
Delay=\u5ef6\u8fdf
Clear=\u6e05\u9664
Close=\u5173\u95ed
Save=\u4fdd\u5b58
JoinMinecraftJar=\u52a0\u5165minecraft.jar
ExternalMods=\u5916\u90e8\u6a21\u7ec4
DynamicLoadingMods=\u52a8\u6001\u52a0\u8f7d\u6a21\u7ec4
Libraries=\u5e93
TagArguments=\u9644\u52a0\u7ed9\u4e88Minecraft\u7684\u53c2\u6570
MainClass=Minecraft\u7684\u4e3b\u7c7b\uff08\u4e0d\u77e5\u9053\u4ec0\u4e48\u610f\u601d\u7684\u8bdd\u4e5f\u5c31\u7528\u4e0d\u4e0a\u4e86\uff09
DefaultLibrariesFolder=\u9ed8\u8ba4\u4e3a.minecraft/libraries\u6587\u4ef6\u5939
DefaultAssetsFolder=\u9ed8\u8ba4\u4e3a.minecraft/assets\u6587\u4ef6\u5939
MakeMCMaximum=\u4f7fMinecraft\u7a97\u53e3\u6700\u5927\u5316
MCFolderFormat=\u5c31\u662fMinecraft\u6587\u4ef6\u5939\u683c\u5f0f
MakeMCFullscreen=\u4f7fMinecraft\u7a97\u53e3\u5168\u5c4f
MCHeight=Minecraft\u7a97\u53e3\u9ad8
MCWidth=Minecraft\u7a97\u53e3\u5bbd
Personalization=\u4e2a\u6027\u5316
MaxPermGen=\u6700\u5927\u6c38\u4e45\u4fdd\u5b58\u533a\u57df\uff08MB\uff09
@@ -0,0 +1,67 @@
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package org.jackhuang.hellominecraftlauncher;
import java.util.List;
import org.jackhuang.hellominecraftlauncher.utilities.LimitedCapacityList;
/**
*
* @author hyh
*/
public class JavaProcess {
private final List<String> commands;
private final Process process;
private final LimitedCapacityList<String> sysOutLines = new LimitedCapacityList<String>(String.class, 5);
public JavaProcess(List<String> commands, Process process) {
this.commands = commands;
this.process = process;
}
public Process getRawProcess() {
return this.process;
}
public List<String> getStartupCommands() {
return this.commands;
}
public String getStartupCommand() {
return this.process.toString();
}
public LimitedCapacityList<String> getSysOutLines() {
return this.sysOutLines;
}
public boolean isRunning() {
try {
this.process.exitValue();
} catch (IllegalThreadStateException ex) {
return true;
}
return false;
}
public int getExitCode() {
try {
return this.process.exitValue();
} catch (IllegalThreadStateException ex) {
ex.fillInStackTrace();
throw ex;
}
}
public String toString() {
return "JavaProcess[commands=" + this.commands + ", isRunning=" + isRunning() + "]";
}
public void stop() {
this.process.destroy();
}
}
@@ -0,0 +1,336 @@
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package org.jackhuang.hellominecraftlauncher;
import java.awt.Dimension;
import java.io.File;
import java.io.IOException;
import java.lang.reflect.Method;
import java.net.URL;
import java.net.URLClassLoader;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;
import org.jackhuang.hellominecraftlauncher.apis.IPlugin;
import org.jackhuang.hellominecraftlauncher.utilities.C;
import org.jackhuang.hellominecraftlauncher.apis.utils.OperatingSystems;
import org.jackhuang.hellominecraftlauncher.apis.utils.Utils;
import org.jackhuang.hellominecraftlauncher.plugin.PluginManager;
/**
*
* @author hyh
*/
public class Launcher {
public static boolean disactivedMods = false;
public static File gameDir = null;
public static boolean ver16 = false, notMove = false;
public static String name = null;
public static void print(String s) {
System.out.println(s);
}
private static File getLocation() {
return gameDir == null ? gameDir = Utils.getLocation() : gameDir;
}
public static void main(String[] args) {
try {
print("*** " + Main.makeTitle() + " ***");
Dimension dimension = null;
boolean fullscreen = false;
String[] inactiveExtMods = null;
String[] inactiveCoreMods = null;
String classPath = "";
String mainClass = "net.minecraft.client.Minecraft";
ArrayList<String> cmdList = new ArrayList<String>();
int width = 854;
int height = 480;
getLocation();
for (int n = 0; n < args.length; n++) {
String s = args[n];
if (s.startsWith("-cp=")) {
classPath = s.substring("-cp=".length());
print(" ClassPath: " + classPath);
} else if (s.startsWith("-windowSize=")) {
String o = s.substring("-windowSize=".length());
dimension = Utils.parseDimension(o);
print(" WindowSize: " + (String) o);
if (dimension == null) {
continue;
}
width = dimension.width;
height = dimension.height;
} else if (s.equals("-windowFullscreen")) {
fullscreen = true;
print(" Fullscreen: " + true);
} else if (s.startsWith("-inactiveExtMods=")) {
s = s.substring("-inactiveExtMods=".length());
inactiveExtMods = Utils.tokenize(s, ";");
print(" InactiveExtMods: " + s);
} else if (s.startsWith("-inactiveCoreMods=")) {
s = s.substring("-inactiveCoreMods=".length());
inactiveCoreMods = Utils.tokenize(s, ";");
print(" InactiveCoreMods: " + s);
} else if (s.startsWith("-mainClass=")) {
mainClass = s.substring("-mainClass=".length());
print(" MainClass: " + mainClass);
} else if (s.equals("-ver16")) {
ver16 = true;
print(" Type: 1.6");
} else if (s.equals("-notMove")) {
notMove = true;
print(" Do not move mods: true");
} else if (s.startsWith("-name=")) {
name = s.substring("-name=".length());
print(" Name: " + name);
} else if (s.startsWith("-gameDir=")) {
gameDir = new File(s.substring("-gameDir=".length()));
print(" GameDir: " + gameDir.getPath());
} else {
cmdList.add(s);
}
}
if (fullscreen
? cmdList.add("--fullscreen")
: (width > 0) && (height > 0)) {
cmdList.add("--width=" + width);
cmdList.add("--height=" + height);
}
String[] cmds = (String[]) cmdList.toArray(new String[cmdList.size()]);
if (classPath == null) {
print("Invalid launcher classpath: " + classPath);
return;
}
String[] tokenized = Utils.tokenize(classPath, File.pathSeparator);
int len = tokenized.length;
File[] files = new File[len];
URL[] urls = new URL[len];
for (int j = 0; j < len; j++) {
files[j] = new File(tokenized[j]);
urls[j] = new File(tokenized[j]).toURI().toURL();
}
URLClassLoader loader = new URLClassLoader(urls);
Class minecraft = loader.loadClass(mainClass);
Method minecraftMain = minecraft.getMethod("main", new Class[]{String[].class});
moveMods();
moveModDir();
disactiveMods(inactiveExtMods, inactiveCoreMods);
addShutdownHook();
System.out.println("Invoking minecraft main()");
minecraftMain.invoke(null, new Object[]{cmds});
addForgeModLoaderHandler();
print("*** Main class main() finished ***");
} catch (Throwable throwable) {
throwable.printStackTrace();
}
}
private static void disactiveMods(String[] inactiveExtMods, String[] inactiveCoreMods) {
disactiveModsByType(inactiveExtMods, "mods");
disactiveModsByType(inactiveCoreMods, "coremods");
disactivedMods = true;
}
private static void addShutdownHook() {
ShutdownHook hook = new ShutdownHook();
Thread thread = new Thread(hook);
Runtime.getRuntime().addShutdownHook(thread);
}
private static void addForgeModLoaderHandler() {
MinecraftHandler handler = new MinecraftHandler();
Logger localLogger = Logger.getLogger("ForgeModLoader");
localLogger.addHandler(handler);
}
private static void disactiveModsByType(String[] paramArrayOfString, String paramString) {
restoreModsByType(paramString);
print("Disable inactive mods: " + paramString);
if ((paramArrayOfString == null) || (paramArrayOfString.length <= 0)) {
return;
}
List<String> al = Arrays.asList(paramArrayOfString);
File[] files = new File(getLocation(), paramString).listFiles();
if (files == null) {
print(" No mods: " + paramString);
return;
}
for (int i = 0; i < files.length; i++) {
File file = files[i];
if (!file.isDirectory()) {
String name = file.getName();
if ((!al.contains(name))
|| ((!name.toLowerCase().endsWith(".zip")) && (!name.toLowerCase().endsWith(".jar")))) {
continue;
}
String newName = name + "x";
File newFile = new File(file.getParentFile(), newName);
if (newFile.exists()) {
newFile.delete();
}
if (file.renameTo(newFile)) {
print(" Disabled: " + name + ", new name: " + newFile.getName());
} else {
print(" Can not disable: " + name);
}
}
}
}
private static void restoreModsByType(String paramString) {
print("Restoring disabled mods: " + paramString);
File[] files = new File(getLocation(), paramString).listFiles();
if (files == null) {
return;
}
for (int i = 0; i < files.length; i++) {
File file = files[i];
if (file.isDirectory()) {
continue;
}
String name = file.getName();
String lowName = name.toLowerCase();
if ((!lowName.endsWith(".zipx")) && (!lowName.endsWith(".jarx"))) {
continue;
}
String newName = name.substring(0, name.length() - 1);
File newFile = new File(file.getParentFile(), newName);
if (newFile.exists()) {
file.delete();
} else {
if (!file.renameTo(newFile)) {
print("Can not rename: " + file.getName() + " to: " + newFile.getName() + " in: " + file.getParent());
}
}
}
}
static void restoreMods() {
if (disactivedMods) {
restoreModsByType("mods");
restoreModsByType("coremods");
disactivedMods = false;
}
}
static void moveMods() {
if(notMove) return;
String realpa = Utils.addSeparator(gameDir.getPath());
java.util.ResourceBundle bundle = C.I18N;
moveModsByType(realpa, name, "mods", bundle.getString("复制普通模组失败: "));
moveModsByType(realpa, name, "coremods", bundle.getString("复制核心模组失败: "));
moveModsByType(realpa, name, "config", bundle.getString("复制配置文件失败: "));
}
static void moveModsByType(String realpa, String name, String type, String error) {
if(notMove) return;
File file = new File(realpa + "versions" + File.separator + name + File.separator + type);
print("Moving mods: " + type);
if (file.exists()) {
File mf = new File(realpa + type);
print("Deleting folder:" + mf.getAbsolutePath());
Utils.deleteAll(mf);
try {
Utils.copyDirectiory(file, mf);
print("Copying folder:" + file.getAbsolutePath());
} catch (IOException e) {
print(error + e.getMessage());
}
} else {
print("Folder doesn't exist: " + file.getAbsolutePath());
}
}
static void moveBackMods() {
if(notMove) return;
String realpa = Utils.addSeparator(gameDir.getPath());
moveBackModsByType(realpa, "mods");
moveBackModsByType(realpa, "coremods");
moveBackModsByType(realpa, "config");
}
static void moveBackModsByType(String realpa, String type) {
if(notMove) return;
if (ver16) {
File fmods = new File(realpa + type);
if (fmods.exists()) {
try {
Utils.copyDirectiory(fmods,
new File(realpa + "versions" + File.separator
+ name + File.separator + type));
} catch (Exception e) {
e.printStackTrace();
}
}
}
}
static void moveModDir() {
if(notMove) return;
String realpa = Utils.addSeparator(gameDir.getPath());
try {
print("Moving mod directory");
Utils.copyDirectiory(realpa + "versions" + File.separator + name + File.separator + "moddir",
realpa);
} catch (IOException ex) {
print("Failed to move mod directory");
Logger.getLogger(Launcher.class.getName()).log(Level.SEVERE, null, ex);
}
}
static void moveBackModDir() {
if(notMove) return;
String realpa = Utils.addSeparator(gameDir.getPath());
File file = new File(realpa + "versions" + File.separator + name + File.separator + "moddir");
if (file.exists()) {
try {
ArrayList<String> al = Utils.findAllDir(file);
for (String s : al) {
File fileto = new File(file, s);
fileto.delete();
File moddir = new File(realpa + s);
Utils.copyDirectiory(moddir, fileto);
}
al = Utils.findAllFile(file);
for (String s : al) {
File fileto = new File(file, s);
fileto.delete();
File moddir = new File(realpa + s);
Utils.copyFile(moddir, fileto);
}
} catch (IOException ex) {
print("Failed to move back mod directory");
Logger.getLogger(Launcher.class.getName()).log(Level.SEVERE, null, ex);
}
}
}
}
@@ -0,0 +1,85 @@
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package org.jackhuang.hellominecraftlauncher;
import java.io.IOException;
import java.io.OutputStream;
/**
*
* @author hyh
*/
public final class LauncherOutputStream extends OutputStream {
private OutputStream a = null;
private OutputStream b = null;
private boolean c = true;
public LauncherOutputStream(OutputStream paramOutputStream1, OutputStream paramOutputStream2) {
this(paramOutputStream1, paramOutputStream2, true);
}
private LauncherOutputStream(OutputStream paramOutputStream1, OutputStream paramOutputStream2, boolean paramBoolean) {
this.a = paramOutputStream1;
this.b = paramOutputStream2;
this.c = paramBoolean;
}
public final void write(byte[] paramArrayOfByte, int paramInt1, int paramInt2) throws IOException {
if (this.a != null) {
this.a.write(paramArrayOfByte, paramInt1, paramInt2);
}
if (this.b != null) {
this.b.write(paramArrayOfByte, paramInt1, paramInt2);
}
if (this.c) {
flush();
}
}
public final void write(byte[] paramArrayOfByte) throws IOException {
if (this.a != null) {
this.a.write(paramArrayOfByte);
}
if (this.b != null) {
this.b.write(paramArrayOfByte);
}
if (this.c) {
flush();
}
}
public final void write(int paramInt) throws IOException {
if (this.a != null) {
this.a.write(paramInt);
}
if (this.b != null) {
this.b.write(paramInt);
}
if (this.c) {
flush();
}
}
public final void close() throws IOException {
flush();
if (this.a != null) {
this.a.close();
}
if (this.b != null) {
this.b.close();
}
}
public final void flush() throws IOException {
if (this.a != null) {
this.a.flush();
}
if (this.b != null) {
this.b.flush();
}
}
}
@@ -0,0 +1,27 @@
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package org.jackhuang.hellominecraftlauncher;
import java.io.OutputStream;
import java.io.PrintStream;
import java.lang.reflect.Array;
/**
*
* @author hyh
*/
public final class LauncherPrintStream extends PrintStream {
private ModLoaderHandler handler = new ModLoaderHandler();
public LauncherPrintStream(OutputStream outputStream) {
super(outputStream);
}
public final void println(String line) {
super.println(line);
this.handler.check(line);
}
}
@@ -0,0 +1,165 @@
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package org.jackhuang.hellominecraftlauncher;
import com.seaglasslookandfeel.SeaGlassLookAndFeel;
import java.awt.Font;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.PrintStream;
import java.net.URLEncoder;
import java.security.GeneralSecurityException;
import java.security.cert.X509Certificate;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.net.ssl.HostnameVerifier;
import javax.net.ssl.HttpsURLConnection;
import javax.net.ssl.SSLContext;
import javax.net.ssl.SSLSession;
import javax.net.ssl.X509TrustManager;
import javax.swing.UIManager;
import org.jackhuang.hellominecraftlauncher.apis.PluginHandlerType;
import org.jackhuang.hellominecraftlauncher.apis.handlers.Login;
import org.jackhuang.hellominecraftlauncher.apis.utils.MonitorInfoBean;
import org.jackhuang.hellominecraftlauncher.apis.utils.MonitorServiceImpl;
import org.jackhuang.hellominecraftlauncher.apis.utils.Utils;
import org.jackhuang.hellominecraftlauncher.download.URLGet;
import org.jackhuang.hellominecraftlauncher.installers.forge.BaseLauncherProfile;
import org.jackhuang.hellominecraftlauncher.plugin.PluginManager;
import org.jackhuang.hellominecraftlauncher.utilities.SettingsManager;
import org.jackhuang.hellominecraftlauncher.views.MainWindow;
import org.jackhuang.metro.MetroLookAndFeel;
/**
*
* @author hyh
*/
public class Main {
// Create an anonymous class to trust all certificates.
// This is bad style, you should create a separate class.
private static X509TrustManager xtm = new X509TrustManager() {
@Override
public void checkClientTrusted(X509Certificate[] chain, String authType) {
}
@Override
public void checkServerTrusted(X509Certificate[] chain, String authType) {
//System.out.println("---cert: " + chain[0].toString() + ", 认证方式: " + authType);
}
@Override
public X509Certificate[] getAcceptedIssuers() {
return null;
}
};
// Create an class to trust all hosts
private static HostnameVerifier hnv = new HostnameVerifier() {
@Override
public boolean verify(String hostname, SSLSession session) {
//System.out.println("hostname:111111111111111111111 " + hostname);
return true;
}
};
static {
// 初始化TLS协议SSLContext
// TrustManager
SSLContext sslContext = null;
try {
sslContext = SSLContext.getInstance("TLS");
X509TrustManager[] xtmArray = new X509TrustManager[]{xtm};
sslContext.init(null, xtmArray, new java.security.SecureRandom());
} catch (GeneralSecurityException gse) {
//打印出一些错误信息和处理这个异常
}
//设置默认的SocketFactory和HostnameVerifier
//为javax.net.ssl.HttpsURLConnection
if (sslContext != null) {
HttpsURLConnection.setDefaultSSLSocketFactory(sslContext.getSocketFactory());
}
HttpsURLConnection.setDefaultHostnameVerifier(hnv);
}
public static String launcherName = "Hello Minecraft! Launcher";
public static int firstVer = 1, secondVer = 9, thirdVer = 4;
public static int minimumLauncherVersion = 13;
public static int pluginVersion = 1;
public static String makeVersion() {
return "" + firstVer + '.' + secondVer + '.' + thirdVer;
}
public static String makeTitle() {
return launcherName + ' ' + makeVersion();
}
public static void main(String[] args) {
try {
PrintStream localPrintStream = System.out;
File file = new File(Utils.addSeparator(Utils.currentDir()) + "hmcl.log");
FileOutputStream fos = new FileOutputStream(file, false);
LauncherOutputStream los = new LauncherOutputStream(localPrintStream, fos);
System.setOut(new LauncherPrintStream(los));
System.setErr(new LauncherPrintStream(los));
} catch (FileNotFoundException ex) {
Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null, ex);
}
try {
//UIManager.setLookAndFeel(new SeaGlassLookAndFeel());
UIManager.setLookAndFeel(new MetroLookAndFeel());
UIManager.getLookAndFeelDefaults().put("defaultFont", new Font("微软雅黑", Font.PLAIN, 12));
} catch (Exception ex) {
java.util.logging.Logger.getLogger(MainWindow.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
}
//</editor-fold>
Runtime.getRuntime().addShutdownHook(new Thread() {
@Override
public void run() {
PluginManager.unloadPlugin();
}
});
PluginHandlerType.registerPluginHandlerType("LOGIN", Login.class);
SettingsManager.load();
try {
PluginManager.preparePlugins();
PluginManager.loadPlugin();
} catch (IOException ex) {
Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null, ex);
}
BaseLauncherProfile.tryWriteProfile(SettingsManager.settings.publicSettings.gameDir);
Thread t = new Thread() {
@Override
public void run() {
long m = 0;
try {
MonitorInfoBean bean = new MonitorServiceImpl().getMonitorInfoBean();
m = bean.getTotalMemorySize() / 1024;
} catch (Exception ex) {
Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null, ex);
}
String url = "http://hellominecraftlauncher.duapp.com/count.php?os=" + URLEncoder.encode(System.getProperty("os.name")) + "&mac=" + Utils.getLocalMAC() +
"&memory=" + m + "&ver=" + makeVersion();
URLGet.get(url);
}
};
t.start();
MainWindow.show(args);
}
}
@@ -0,0 +1,50 @@
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package org.jackhuang.hellominecraftlauncher;
import java.util.logging.Handler;
import java.util.logging.Level;
import java.util.logging.LogRecord;
/**
*
* @author hyh
*/
public class MinecraftHandler extends Handler {
private boolean restore;
MinecraftHandler() {
restore = false;
}
@Override
public final void publish(LogRecord logrecord) {
if (restore) {
return;
}
String s = logrecord.getMessage();
if (s == null) {
return;
}
if (logrecord.getLevel().intValue() < Level.INFO.intValue()) {
return;
}
if (s.startsWith("Forge Mod Loader has successfully loaded") && s.endsWith("mods")) {
restore = true;
}
if (restore) {
Launcher.restoreMods();
}
}
@Override
public final void close() {
}
@Override
public final void flush() {
}
}
@@ -0,0 +1,39 @@
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package org.jackhuang.hellominecraftlauncher;
import java.io.File;
import java.net.URLClassLoader;
/**
*
* @author hyh
*/
public class ModLoaderHandler {
private boolean ended = false;
public void check(String line) {
if (this.ended) {
return;
}
if (line == null) {
return;
}
if ((!line.equals("Done.")
&& (!line.startsWith("Starting up SoundSystem"))
&& (!line.startsWith("Loading: net.java.games.input."))
&& (!line.startsWith("Found animation info for:"))
? 0 : 1) != 0) {
this.ended = true;
Launcher.restoreMods();
}
}
ModLoaderHandler() {
super();
ended = false;
}
}
@@ -0,0 +1,18 @@
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package org.jackhuang.hellominecraftlauncher;
/**
*
* @author jack
*/
public class Pair<K,T> {
public K key;
public T value;
public Pair(K key, T value) {
this.key = key;
this.value = value;
}
}
@@ -0,0 +1,30 @@
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package org.jackhuang.hellominecraftlauncher;
import org.jackhuang.hellominecraftlauncher.apis.IPlugin;
import org.jackhuang.hellominecraftlauncher.plugin.PluginManager;
/**
*
* @author hyh
*/
public final class ShutdownHook implements Runnable {
@Override
public final void run() {
Launcher.restoreMods();
Launcher.moveBackMods();
Launcher.moveBackModDir();
try {
for(IPlugin p : PluginManager.plugins) {
p.minecraftStopped();
}
} catch(Throwable t) {
}
}
}
@@ -0,0 +1,37 @@
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package org.jackhuang.hellominecraftlauncher.installers;
import java.io.File;
import java.util.ArrayList;
import org.jackhuang.hellominecraftlauncher.apis.utils.Utils;
import org.jackhuang.hellominecraftlauncher.apis.utils.Compressor;
/**
*
* @author hyh
*/
public class PackMinecraftInstaller {
String dest;
ArrayList<String> src;
public PackMinecraftInstaller(ArrayList<String> src, String dest) {
this.dest = dest;
this.src = src;
}
public void install() {
String path = Utils.addSeparator(Utils.currentDir())
+ "HMCL-MERGE-TEMP" + File.separator;
File file = new File(path);
file.mkdirs();
for (int i = 0; i < src.size(); i++) {
Compressor.unzip(src.get(i), path);
}
Compressor.zip(path, dest);
Utils.deleteAll(file);
}
}
@@ -0,0 +1,21 @@
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package org.jackhuang.hellominecraftlauncher.installers.forge;
import java.io.File;
import org.jackhuang.hellominecraftlauncher.apis.utils.Utils;
/**
*
* @author hyh
*/
public class BaseLauncherProfile {
public static String profile = "{\"selectedProfile\": \"(Default)\",\"profiles\": {\"(Default)\": {\"name\": \"(Default)\"}},\"clientToken\": \"88888888-8888-8888-8888-888888888888\"}";
public static void tryWriteProfile(String gameDir) {
File file = new File(Utils.addSeparator(gameDir) + "launcher_profiles.json");
if(!file.exists())
Utils.writeToFile(file, profile);
}
}
@@ -0,0 +1,185 @@
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package org.jackhuang.hellominecraftlauncher.installers.forge;
import com.google.gson.Gson;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;
import org.jackhuang.hellominecraftlauncher.apis.DoneListener;
import org.jackhuang.hellominecraftlauncher.download.URLGet;
import org.jackhuang.hellominecraftlauncher.utilities.C;
import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import org.jsoup.nodes.Element;
import org.jsoup.select.Elements;
/**
*
* @author hyh
*/
public class ForgeFormatThread extends Thread {
DoneListener<List<ForgeVersion>, Object> lis;
int type;
public ForgeFormatThread(DoneListener<List<ForgeVersion>, Object> lis, int type) {
this.lis = lis;
this.type = type;
}
public static List<ForgeVersion> formatNew() {
ArrayList<ForgeVersion> al = new ArrayList<ForgeVersion>();
try {
Document doc = Jsoup.connect("http://files.minecraftforge.net/").get();
Elements allbuilds = doc.getElementsByClass("builds");
Elements tables = new Elements();
for(Element build : allbuilds)
tables.addAll(build.getElementsByTag("table"));
Elements allforge = new Elements();
for(Element table : tables)
allforge.addAll(table.getElementsByTag("tr"));
tables = null;
for(Element e : allforge) {
Elements tds = e.getElementsByTag("td");
if(tds.isEmpty()) continue;
ForgeVersion v = new ForgeVersion();
v.ver = tds.get(0).text();
v.mcver = tds.get(1).text();
v.releasetime = tds.get(2).text();
v.installer = new String[2];
v.universal = new String[2];
v.javadoc = new String[2];
v.src = new String[2];
v.userdev = new String[2];
Elements a = tds.get(3).getElementsByTag("a");
String prev = null;
for(Element e2 : a) {
String href = e2.attributes().get("href").toLowerCase();
if(e2.text().toLowerCase().indexOf("changelog") != -1) {
v.changelog = href;
} else if(prev != null) {
int index;
if(href.indexOf("adf.ly") != -1) index = 0;
else index = 1;
if(prev.toLowerCase().indexOf("installer") != -1) {
v.installer[index] = href;
} else
if(prev.toLowerCase().indexOf("universal") != -1) {
v.universal[index] = href;
} else
if(prev.toLowerCase().indexOf("javadoc") != -1) {
v.javadoc[index] = href;
} else
if(prev.toLowerCase().indexOf("src") != -1) {
v.src[index] = href;
} else
if(prev.toLowerCase().indexOf("userdev") != -1) {
v.userdev[index] = href;
}
}
prev = e2.text();
}
al.add(v);
}
} catch (Exception ex) {
Logger.getLogger(ForgeFormatThread.class.getName()).log(Level.SEVERE, null, ex);
ForgeVersion v = new ForgeVersion();
v.ver = "获取失败";
al.add(v);
}
return al;
}
public static List<ForgeVersion> formatLegacy() {
ArrayList<ForgeVersion> al = new ArrayList<ForgeVersion>();
try {
Document doc = Jsoup.connect("http://files.minecraftforge.net/minecraftforge/index_legacy.html").get();
Element allbuilds = doc.getElementById("all_builds");
Elements mainTable = allbuilds.getElementsByTag("table");
Element table = mainTable.first();
Elements allforge = table.getElementsByTag("tr");
for(Element e : allforge) {
Elements tds = e.getElementsByTag("td");
if(tds.isEmpty()) continue;
ForgeVersion v = new ForgeVersion();
v.ver = tds.get(0).text();
v.mcver = tds.get(1).text();
v.releasetime = tds.get(2).text();
v.installer = new String[2];
v.universal = new String[2];
v.javadoc = new String[2];
Elements a = tds.get(3).getElementsByTag("a");
String prev = null;
for(Element e2 : a) {
String href = e2.attributes().get("href").toLowerCase();
if(e2.text().toLowerCase().indexOf("changelog") != -1) {
v.changelog = href;
} else if(prev != null) {
int index;
if(href.indexOf("adf.ly") != -1) index = 0;
else index = 1;
if(prev.toLowerCase().indexOf("installer") != -1) {
v.installer[index] = href;
} else
if(prev.toLowerCase().indexOf("universal") != -1) {
v.universal[index] = href;
} else
if(prev.toLowerCase().indexOf("javadoc") != -1) {
v.javadoc[index] = href;
} else
if(prev.toLowerCase().indexOf("src") != -1) {
v.src[index] = href;
}
}
prev = e2.text();
}
al.add(v);
}
} catch (Exception ex) {
//Logger.getLogger(ForgeFormatThread.class.getName()).log(Level.SEVERE, null, ex);
ForgeVersion v = new ForgeVersion();
v.ver = "获取失败";
al.add(v);
}
return al;
}
public static ForgeVersion[] formatBMCL(String url) {
String s = URLGet.get(url);
return new Gson().fromJson(s, ForgeVersion[].class);
}
@Override
public void run() {
List<ForgeVersion> al = null;
switch(type) {
case 0:
al = formatNew();
al.addAll(formatLegacy());
break;
case 1:
al = new ArrayList<ForgeVersion>();
for(ForgeVersion fv : formatBMCL(C.URL_FORGE_BMCL_NEW)) {
al.add(fv);
}
for(ForgeVersion fv : formatBMCL(C.URL_FORGE_BMCL_LEGACY)) {
al.add(fv);
}
break;
}
if(lis != null)
lis.onDone(al, null);
}
}
@@ -0,0 +1,23 @@
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package org.jackhuang.hellominecraftlauncher.installers.forge;
import java.util.ArrayList;
import org.jackhuang.hellominecraftlauncher.installers.PackMinecraftInstaller;
/**
*
* @author hyh
*/
public class ForgeOldInstaller {
public static void install(String destMinecraftJar, String srcMinecraftJar, String forgeUniversal) {
ArrayList<String> al = new ArrayList<String>();
al.add(srcMinecraftJar);
al.add(forgeUniversal);
new PackMinecraftInstaller(al, destMinecraftJar).install();
}
}
@@ -0,0 +1,15 @@
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package org.jackhuang.hellominecraftlauncher.installers.forge;
/**
*
* @author hyh
*/
public class ForgeVersion {
public String vername, ver, mcver, releasetime, changelog;
public String[] installer, javadoc, src, universal, userdev;
public int typeint;
}
@@ -0,0 +1,69 @@
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package org.jackhuang.hellominecraftlauncher.installers.optifine;
import java.net.URLEncoder;
import java.util.logging.Level;
import java.util.logging.Logger;
import org.jackhuang.hellominecraftlauncher.apis.DoneListener;
import org.jackhuang.hellominecraftlauncher.download.URLGet;
import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import org.jsoup.nodes.Element;
/**
*
* @author hyh
*/
public class OptifineFormatDownloadThread extends Thread {
DoneListener<String, Object> lis;
OptifineVersion source;
int type;
public OptifineFormatDownloadThread(DoneListener<String, Object> lis, OptifineVersion source, int type) {
this.lis = lis;
this.type = type;
this.source = source;
}
public static String format(String source) {
String url;
try {
Document doc = Jsoup.connect(source).get();
Element download = doc.getElementById("Download");
Element a = download.getElementsByTag("a").first();
url = "http://optifine.net/" + a.attributes().get("href");
} catch (Exception ex) {
Logger.getLogger(OptifineFormatThread.class.getName()).log(Level.SEVERE, null, ex);
OptifineVersion v = new OptifineVersion();
url = null;
}
return url;
}
public static String format_bmcl(String source) {
String url = "http://bmclapi.bangbang93.com/optifine/" + URLEncoder.encode(source);
return URLGet.get(url);
}
@Override
public void run() {
String url = null;
switch(type) {
case 0:
url = format(source.dl);
break;
case 1:
url = format_bmcl(source.ver);
break;
}
if(lis != null)
lis.onDone(url, null);
}
}
@@ -0,0 +1,98 @@
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package org.jackhuang.hellominecraftlauncher.installers.optifine;
import com.google.gson.Gson;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import org.jackhuang.hellominecraftlauncher.apis.DoneListener;
import org.jackhuang.hellominecraftlauncher.download.URLGet;
import org.jackhuang.hellominecraftlauncher.utilities.C;
import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import org.jsoup.nodes.Element;
import org.jsoup.select.Elements;
/**
*
* @author hyh
*/
public class OptifineFormatThread extends Thread {
DoneListener<List<OptifineVersion>, Object> lis;
int type;
public OptifineFormatThread(DoneListener<List<OptifineVersion>, Object> lis, int type) {
this.lis = lis;
this.type = type;
}
public static List<OptifineVersion> format(String source) {
List<OptifineVersion> al = new ArrayList<OptifineVersion>();
try {
Document doc = Jsoup.connect(source).get();
Elements downloads = doc.getElementsByClass("downloads");
Element table = downloads.first();
Elements tds = table.getElementsByTag("td");
Element td = tds.first();
Elements allopt = td.children();
String lasth2 = "", lasth3 = "";
for(int i = 0; i < allopt.size(); i++) {
Element e = allopt.get(i);
String tagName = e.tagName().toLowerCase();
if(tagName.indexOf("h3") != -1) {
lasth3 = e.text();
String[] s = lasth3.split(" ");
lasth3 = s[s.length - 1];
} else if(tagName.indexOf("h2") != -1) {
lasth2 = e.text().split(" ")[1];
} else
if(tagName.indexOf("table") != -1) {
Elements downloadLines = e.getElementsByTag("tr");
for(Element downloadLine : downloadLines) {
OptifineVersion v = new OptifineVersion();
v.type = lasth3;
String[] ver = downloadLine.child(0).text().split(" ");
if(ver.length < 1) continue;
v.ver = ver[ver.length - 1];
v.mcver = lasth2;
Element mirror = downloadLine.child(2).child(0);
v.dl = mirror.attributes().get("href");
v.date = downloadLine.child(3).text();
al.add(v);
}
}
}
} catch (Exception ex) {
System.err.println(ex.getMessage());
//Logger.getLogger(OptifineFormatThread.class.getName()).log(Level.SEVERE, null, ex);
OptifineVersion v = new OptifineVersion();
v.ver = "获取失败";
al.add(v);
}
return al;
}
public static List<OptifineVersion> format_bmcl(String source) {
Gson gson = new Gson();
return Arrays.asList(gson.fromJson(URLGet.get(source), OptifineVersion[].class));
}
@Override
public void run() {
List<OptifineVersion> al;
if(type == 0) {
al = format(C.URL_OPTIFINE[0]);
} else {
al = format_bmcl(C.URL_OPTIFINE[1]);
}
if(lis != null)
lis.onDone(al, null);
}
}
@@ -0,0 +1,13 @@
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package org.jackhuang.hellominecraftlauncher.installers.optifine;
/**
*
* @author hyh
*/
public class OptifineVersion {
public String dl, ver, mcver, date, type;
}
@@ -0,0 +1,153 @@
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package org.jackhuang.hellominecraftlauncher.loaders;
import java.io.File;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import org.jackhuang.hellominecraftlauncher.apis.handlers.LoginResult;
import org.jackhuang.hellominecraftlauncher.apis.utils.OperatingSystems;
import org.jackhuang.hellominecraftlauncher.apis.utils.Utils;
import org.jackhuang.hellominecraftlauncher.settings.Version;
import org.jackhuang.hellominecraftlauncher.utilities.SettingsManager;
/**
*
* @author hyh
*/
public abstract class IMinecraftLoader {
protected String minecraftJar;
protected Version v;
protected LoginResult lr;
public IMinecraftLoader(Version pub, Version ver, LoginResult lr, String minecraftJar) {
this.lr = lr;
this.minecraftJar = minecraftJar;
v = new Version(ver);
if(Utils.isEmpty(ver.gameDir)) v.gameDir = Utils.addSeparator(pub.gameDir);
if(Utils.isEmpty(ver.gameAssets)) v.gameAssets = pub.gameAssets;
if(Utils.isEmpty(v.gameAssets)) v.gameAssets = v.gameDir + "assets";
if(Utils.isEmpty(ver.gameLibraries)) v.gameLibraries = pub.gameLibraries;
if(Utils.isEmpty(ver.height)) v.height = pub.height;
if(Utils.isEmpty(ver.javaArgs)) v.javaArgs = pub.javaArgs;
if(Utils.isEmpty(ver.javaDir)) v.javaDir = pub.javaDir;
if(Utils.isEmpty(ver.mainClass)) v.mainClass = pub.mainClass;
if(Utils.isEmpty(ver.maxMemory)) v.maxMemory = pub.maxMemory;
if(Utils.isEmpty(ver.name)) v.name = pub.name;
if(Utils.isEmpty(ver.width)) v.width = pub.width;
if(Utils.isEmpty(ver.minecraftArguments)) v.minecraftArguments = pub.minecraftArguments;
}
public List<String> makeLaunchingCommand() {
System.out.println("*** Making Minecraft Launching Command ***");
ArrayList<String> res = new ArrayList<String>();
String java;
if(!Utils.isEmpty(v.javaDir.trim()))
{
if(Utils.os() == OperatingSystems.WINDOWS) {
File file = new File(Utils.addSeparator(v.javaDir) + "javaw.exe");
if(file.exists() && file.isFile())
java = "javaw.exe";
else
java = "java.exe";
} else {
java = "java";
}
java = Utils.addSeparator(v.javaDir) + java;
}
else
java = Utils.getJavaDir();
System.out.println("Java path: " + java);
res.add(java);
if(!Utils.isEmpty(v.javaArgs.trim()))
{
System.out.println("Java args: " + v.javaArgs);
res.add(v.javaArgs);
}
res.add("-Xincgc");
if(!Utils.isEmpty(v.maxMemory))
{
System.out.println("Memory: " + v.maxMemory);
res.add("-Xmx" + v.maxMemory + "m");
}
makeJavaLibraryPath(res);
res.add("-Dfml.ignoreInvalidMinecraftCertificates=true");
res.add("-Dfml.ignorePatchDiscrepancies=true");
res.add("-Dsun.java2d.noddraw=true");
res.add("-Dsun.java2d.pmoffscreen=false");
res.add("-Dsun.java2d.d3d=false");
res.add("-Dsun.java2d.opengl=false");
if(Utils.os() != OperatingSystems.WINDOWS)
{
String base = new File(v.gameDir).getParent();
System.out.println("Base folder: " + base);
res.add("-Duser.home=" + base);
}
res.add("-cp");
res.add(Utils.parseParams("", Utils.getURL(), File.pathSeparator));
res.add("org.jackhuang.hellominecraftlauncher.Launcher");
makeSelf(res);
if(!Utils.isEmpty(v.height) && !Utils.isEmpty(v.width))
{
res.add("-windowSize=" + v.width + "x" + v.height);
}
if(v.fullscreen)
res.add("-windowFullscreen");
if(v.inactiveCoreMods != null && !v.inactiveCoreMods.isEmpty()) {
String s = "-inactiveCoreMods=" + Utils.parseParams(
"",
v.inactiveCoreMods.toArray(), File.pathSeparator
);
res.add(s);
}
if(v.inactiveExtMods != null && !v.inactiveExtMods.isEmpty()) {
String s = "-inactiveExtMods=" + Utils.parseParams(
"",
v.inactiveExtMods.toArray(), File.pathSeparator);
res.add(s);
}
if(!Utils.isEmpty(v.minecraftArguments))
{
String[] splitted2 = Utils.tokenize(v.minecraftArguments);
res.addAll(Arrays.asList(splitted2));
}
res.add("-gameDir=" + v.gameDir);
if(SettingsManager.settings.disableMoveMods)
res.add("-notMove");
return res;
}
protected abstract void makeJavaLibraryPath(List<String> list);
/**
* 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);
public Version getUserVersion()
{
return v;
}
}
@@ -0,0 +1,15 @@
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package org.jackhuang.hellominecraftlauncher.loaders;
/**
*
* @author hyh
*/
public class Latest {
public String snapshot, release;
}
@@ -0,0 +1,25 @@
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package org.jackhuang.hellominecraftlauncher.loaders;
import java.util.List;
/**
*
* @author hyh
*/
public class LaunchRequest {
public boolean windowMaximized;
public boolean windowFullscreen;
public boolean showLog;
public int width, height;
public String classPath;
public String[] inactiveExtMods, inactiveCoreMods;
public List<String> minecraftArguments;
public List<String> launchStrings;
}
@@ -0,0 +1,133 @@
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package org.jackhuang.hellominecraftlauncher.loaders;
import org.jackhuang.hellominecraftlauncher.apis.utils.Utils;
import org.jackhuang.hellominecraftlauncher.apis.version.MinecraftLibrary;
import org.jackhuang.hellominecraftlauncher.apis.version.MinecraftVersion;
import org.jackhuang.hellominecraftlauncher.settings.Version;
import java.io.File;
import java.util.List;
import org.jackhuang.hellominecraftlauncher.apis.handlers.LoginResult;
/**
*
* @author hyh
*/
public class MinecraftLoader extends IMinecraftLoader {
private MinecraftVersion version;
String text;
public MinecraftLoader(MinecraftVersion mvt, Version pub, Version ver, LoginResult lr, String minecraftJar)
{
super(pub, ver, lr, minecraftJar);
version = mvt;
for(int i = 0; i < version.libraries.size(); i++)
{
MinecraftLibrary l = version.libraries.get(i);
String str = l.name;
String[] s = str.split(":");
str = s[0];
str = str.replace('.', File.separatorChar);
if(l.natives == null)
str += File.separator + s[1] + File.separator + s[2] +
File.separator + s[1] + '-' + s[2] + ".jar";
else
{
str += File.separator + s[1] + File.separator + s[2] +
File.separator + s[1] + '-' + s[2] + '-';
str += l.getNative();
str += ".jar";
}
l.formatted = str;
version.libraries.set(i, l);
}
}
@Override
protected void makeJavaLibraryPath(List<String> res) {
String library = "-Djava.library.path=";
library += Utils.addSeparator(v.gameDir) + "versions" +
File.separator + getVersion().id + File.separator + getVersion().id +
"-natives";
res.add(library);
}
@Override
protected void makeSelf(List<String> res)
{
String realpa = Utils.addSeparator(v.gameDir);
String library = "-cp=";
String librariespath = realpa + "libraries" + File.separator;
if(!v.gameLibraries.equals("")) librariespath = v.gameLibraries;
if(v.firstLoadLibraries != null)
for(int i = 0; i < v.firstLoadLibraries.size(); i++)
if(v.firstLoadLibrariesIsActive == null || v.firstLoadLibrariesIsActive.get(i))
library += v.firstLoadLibraries.get(i) + File.pathSeparator;
for(int i = 0; i < getVersion().libraries.size(); i++)
{
MinecraftLibrary l = getVersion().libraries.get(i);
if(l.allow())
{
library += librariespath + l.formatted + File.pathSeparator;
}
}
library += minecraftJar + File.pathSeparator;
if(v.lastLoadLibraries != null)
for(int i = 0; i < v.lastLoadLibraries.size(); i++)
if(v.lastLoadLibrariesIsActive == null || v.lastLoadLibrariesIsActive.get(i))
library += v.lastLoadLibraries.get(i) + File.pathSeparator;
library = library.substring(0, library.length() - File.pathSeparator.length());
res.add(library);
String mainClass;
if(Utils.isEmpty(v.mainClass))
mainClass = getVersion().mainClass;
else
mainClass = v.mainClass;
System.out.println("Main class: " + mainClass);
res.add("-mainClass=" + mainClass);
String arg = getVersion().minecraftArguments;
String[] splitted = Utils.tokenize(arg);
for(String t : splitted) {
t = t.replace("${auth_player_name}", lr.username);
t = t.replace("${auth_session}", lr.session);
t = t.replace("${auth_uuid}", lr.userId);
t = t.replace("${version_name}", getVersion().id);
t = t.replace("${game_directory}", v.gameDir);
t = t.replace("${game_assets}", v.gameAssets);
t = t.replace("${assets_root}", v.gameAssets);
t = t.replace("${auth_access_token}", lr.accessToken);
t = t.replace("${user_type}", lr.userType);
if(getVersion().assets != null)
t = t.replace("${assets_index_name}", getVersion().assets);
t = t.replace("${user_properties}", lr.userProperties);
res.add(t);
}
if(res.indexOf("--gameDir") != -1 && res.indexOf("--workDir") != -1) {
res.add("--workDir");
res.add(v.gameDir);
}
res.add("-ver16");
res.add("-name=" + v.name);
}
/**
* @return the version
*/
public MinecraftVersion getVersion() {
return version;
}
/**
* @param version the version to set
*/
public void setVersion(MinecraftVersion version) {
this.version = version;
}
}
@@ -0,0 +1,67 @@
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package org.jackhuang.hellominecraftlauncher.loaders;
import java.io.File;
import java.io.UnsupportedEncodingException;
import java.net.URL;
import java.net.URLClassLoader;
import java.net.URLDecoder;
import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;
import org.jackhuang.hellominecraftlauncher.apis.handlers.LoginResult;
import org.jackhuang.hellominecraftlauncher.apis.utils.Utils;
import org.jackhuang.hellominecraftlauncher.settings.Version;
/**
*
* @author hyh
*/
public class MinecraftOldLoader extends IMinecraftLoader {
public MinecraftOldLoader(Version pub, Version ver, LoginResult lr, String minecraftJar)
{
super(pub, ver, lr, minecraftJar);
}
@Override
protected void makeJavaLibraryPath(List<String> res) {
res.add("-Djava.library.path=" + v.gameDir + "bin" + File.separator + "natives");
}
@Override
protected void makeSelf(List<String> res)
{
String library = "-cp=";
if(v.firstLoadLibraries != null)
for(int i = 0; i < v.firstLoadLibraries.size(); i++)
if(v.firstLoadLibrariesIsActive == null || v.firstLoadLibrariesIsActive.get(i))
library += v.firstLoadLibraries.get(i) + File.pathSeparator;
library += v.gameDir + "bin" + File.separator + "jinput.jar" + File.pathSeparator +
v.gameDir + "bin" + File.separator + "lwjgl.jar" + File.pathSeparator +
v.gameDir + "bin" + File.separator + "lwjgl_util.jar" + File.pathSeparator;
library += minecraftJar + File.separator;
if(v.lastLoadLibraries != null)
for(int i = 0; i < v.lastLoadLibraries.size(); i++)
if(v.lastLoadLibrariesIsActive == null || v.lastLoadLibrariesIsActive.get(i))
library += v.lastLoadLibraries.get(i) + File.pathSeparator;
library = library.substring(0, library.length() - File.pathSeparator.length());
res.add(library);
String mainClass;
if(Utils.isEmpty(v.mainClass))
mainClass = "net.minecraft.client.Minecraft";
else
mainClass = v.mainClass;
System.out.println("Main class: " + mainClass);
res.add("-mainClass=" + mainClass);
res.add(lr.username);
res.add(lr.session);
res.add("--workDir");
res.add(v.gameDir);
}
}
@@ -0,0 +1,19 @@
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package org.jackhuang.hellominecraftlauncher.loaders;
import org.jackhuang.hellominecraftlauncher.apis.version.MinecraftVersion;
import java.util.ArrayList;
/**
*
* @author hyh
*/
public class MinecraftVersions {
public ArrayList<MinecraftVersion> versions;
public Latest latest;
}
@@ -0,0 +1,33 @@
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package org.jackhuang.hellominecraftlauncher.loaders;
import com.google.gson.Gson;
/**
*
* @author hyh
*/
public class MinecraftVersionsLoader {
String JSON;
Gson gson;
private MinecraftVersions versions;
public MinecraftVersionsLoader(String j) {
gson = new Gson();
JSON = j;
versions = gson.fromJson(JSON, MinecraftVersions.class);
}
/**
* @return the versions
*/
public MinecraftVersions getVersions() {
return versions;
}
}
@@ -0,0 +1,13 @@
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package org.jackhuang.hellominecraftlauncher.loaders.packages;
/**
*
* @author hyh
*/
public class Packages {
public String author, mcversion, version, name, type;
}
@@ -0,0 +1,14 @@
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package org.jackhuang.hellominecraftlauncher.loaders.serverlist;
/**
*
* @author hyh
*/
public class ServerInfo {
public String name, address;
public boolean isHide;
}
@@ -0,0 +1,151 @@
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package org.jackhuang.hellominecraftlauncher.loaders.serverlist;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.FileReader;
import java.io.IOException;
import java.util.ArrayList;
import java.util.logging.Level;
import java.util.logging.Logger;
import sun.misc.BASE64Decoder;
/**
*
* @author hyh
*/
public class ServerList {
public static String address = "AmlwAA==";
public static String header = "CgAACQAHc2VydmVycwoAAA==";
public static String hideAddress = "AAtoaWRlQWRkcmVzcw==";
public static String name = "AARuYW1lAA==";
public ArrayList<ServerInfo> list;
public File file;
public ServerList(File file) {
this.file = file;
if(!file.exists())
try {
file.getParentFile().mkdirs();
file.createNewFile();
} catch (IOException ex) {
Logger.getLogger(ServerList.class.getName()).log(Level.SEVERE, null, ex);
}
this.list = new ArrayList<ServerInfo>();
try {
FileInputStream stream = new FileInputStream(file);
byte[] header = new byte[0x13];
stream.read(header, 0, header.length);
if(stream.available() < 5) {
stream.close();
return;
}
while(stream.available() > 0) {
byte[] hideAddress = new byte[13];
stream.read(hideAddress, 0, hideAddress.length);
boolean isHide = stream.read() == 1 ? true : false;
byte[] name = new byte[9];
stream.read(name, 0, name.length);
ArrayList<Byte> nameList = new ArrayList<Byte>(20);
byte ch = (byte) stream.read();
while(ch != 0) {
if(ch == -1) break;
nameList.add(ch);
ch = (byte) stream.read();
}
if(ch == -1) break;
byte[] names = new byte[nameList.size()];
for(int i = 0; i < nameList.size(); i++) {
names[i] = nameList.get(i);
}
String Name = new String(names);
byte[] address = new byte[5];
stream.read(address, 0, address.length);
ArrayList<Byte> AddRess = new ArrayList<Byte>(20);
ch = (byte) stream.read();
while(ch != 0) {
if(ch == -1) break;
AddRess.add(ch);
ch = (byte) stream.read();
}
if(ch == -1) break;
byte[] addresses = new byte[AddRess.size()];
for(int i = 0; i < AddRess.size(); i++) {
addresses[i] = AddRess.get(i);
}
String Address = new String(addresses);
ServerInfo info = new ServerInfo();
info.address = Address;
info.isHide = isHide;
info.name = Name;
list.add(info);
if(stream.read() == 0)
break;
}
} catch (FileNotFoundException ex) {
Logger.getLogger(ServerList.class.getName()).log(Level.SEVERE, null, ex);
} catch (IOException ex) {
Logger.getLogger(ServerList.class.getName()).log(Level.SEVERE, null, ex);
}
}
public void write() {
try {
FileOutputStream stream = new FileOutputStream(file);
BASE64Decoder decoder = new BASE64Decoder();
stream.write(decoder.decodeBuffer(header));
int p = 0;
stream.write(0);
stream.write(list.size());
stream.write(1);
for(ServerInfo info : list) {
p++;
stream.write(decoder.decodeBuffer(hideAddress));
if(info.isHide)
stream.write(1);
else
stream.write(0);
stream.write(8);
stream.write(decoder.decodeBuffer(name));
stream.write(info.name.length());
stream.write(info.name.getBytes());
stream.write(new byte[]{8, 0});
stream.write(decoder.decodeBuffer(address));
stream.write(info.address.length());
stream.write(info.address.getBytes());
stream.write(0);
if(p != list.size())
stream.write(1);
else
stream.write(0);
}
stream.close();
} catch (FileNotFoundException ex) {
Logger.getLogger(ServerList.class.getName()).log(Level.SEVERE, null, ex);
} catch (IOException ex) {
Logger.getLogger(ServerList.class.getName()).log(Level.SEVERE, null, ex);
}
}
public static void writeEmptyFile(File path) {
try {
FileOutputStream serverdat = new FileOutputStream(path);
BASE64Decoder decoder = new BASE64Decoder();
byte[] writes = decoder.decodeBuffer(header);
serverdat.write(writes, 0, writes.length);
serverdat.write(0);
serverdat.close();
} catch (IOException ex) {
Logger.getLogger(ServerList.class.getName()).log(Level.SEVERE, null, ex);
}
}
}
@@ -0,0 +1,30 @@
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package org.jackhuang.hellominecraftlauncher.models;
/**
*
* @author hyh
*/
public class ControllerAction<T> {
/**
* -1 - NULL
* 1 - delete version<br />
* 2 - new version<br />
* 3 - copy version<br />
* 4 - import version<br />
* 5 - import folder<br />
* 6 - cannot find minecraft.jar<br />
* 7 - find the same name in the list<br />
*/
int action;
T content;
public ControllerAction(int action, T content) {
this.action = action;
this.content = content;
}
}
@@ -0,0 +1,54 @@
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package org.jackhuang.hellominecraftlauncher.models;
import org.jackhuang.hellominecraftlauncher.apis.version.MinecraftVersion;
import com.google.gson.Gson;
import java.io.File;
import java.io.IOException;
import java.util.logging.Level;
import java.util.logging.Logger;
import org.jackhuang.hellominecraftlauncher.apis.utils.Utils;
/**
*
* @author hyh
*/
public class VersionCopier {
public static boolean copy(String gameDir, String fromName, String toName) {
gameDir = Utils.addSeparator(gameDir);
File fromDir = new File(gameDir + fromName + File.separator);
if(!fromDir.exists()) return false;
File toDir = new File(gameDir + toName + File.separator);
toDir.mkdirs();
File fromMinecraftJar = new File(gameDir + fromName + File.separator + fromName + ".jar");
File toMinecraftJar = new File(gameDir + fromName + File.separator + toName + ".jar");
File fromMinecraftJson = new File(gameDir + fromName + File.separator + fromName + ".json");
File toMinecraftJson = new File(gameDir + fromName + File.separator + toName + ".json");
File fromMinecraftMods = new File(gameDir + fromName + File.separator + "mods" + File.separator);
File toMinecraftMods = new File(gameDir + fromName + File.separator + "mods" + File.separator);
File fromMinecraftCoreMods = new File(gameDir + fromName + File.separator + "coremods" + File.separator);
File toMinecraftCoreMods = new File(gameDir + fromName + File.separator + "coremods" + File.separator);
File fromMinecraftConfig = new File(gameDir + fromName + File.separator + "config" + File.separator);
File toMinecraftConfig = new File(gameDir + fromName + File.separator + "config" + File.separator);
try {
Utils.copyFile(fromMinecraftJar, toMinecraftJar);
String str = Utils.readToEnd(fromMinecraftJson);
Gson gson = new Gson();
MinecraftVersion v = gson.fromJson(str, MinecraftVersion.class);
v.id = toName;
Utils.writeToFile(toMinecraftJson, gson.toJson(v));
Utils.copyDirectiory(fromMinecraftMods, toMinecraftMods);
Utils.copyDirectiory(fromMinecraftCoreMods, toMinecraftCoreMods);
Utils.copyDirectiory(fromMinecraftConfig, toMinecraftConfig);
} catch (IOException ex) {
Logger.getLogger(VersionCopier.class.getName()).log(Level.SEVERE, null, ex);
return false;
}
return true;
}
}
@@ -0,0 +1,62 @@
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package org.jackhuang.hellominecraftlauncher.models;
import java.io.File;
import javax.swing.JFileChooser;
import javax.swing.JOptionPane;
import org.jackhuang.hellominecraftlauncher.apis.utils.Utils;
import org.jackhuang.hellominecraftlauncher.utilities.C;
import org.jackhuang.hellominecraftlauncher.utilities.MinecraftOldVersionIncluder;
import org.jackhuang.hellominecraftlauncher.utilities.SettingsManager;
/**
*
* @author hyh
*/
public class VersionManager {
/**
* 导入旧版本
* @param mcp
* @return Controller Action
*/
public ControllerAction<String> includeOldVersion() {
JFileChooser fc = new JFileChooser();
fc.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
fc.setDialogTitle(C.I18N.getString("选择MINECRAFT路径"));
fc.setMultiSelectionEnabled(false);
fc.showOpenDialog(null);
try {
String mcp = fc.getSelectedFile().getCanonicalPath();
if (mcp == null || mcp.trim().equals("")) {
return new ControllerAction<String>(-1, "");
}
File file = new File(mcp + File.separator + "bin" + File.separator + "minecraft.jar");
if (!file.exists()) {
//MessageBox.Show(C.I18N.getString("找不到MINECRAFT.JAR"));
return new ControllerAction<String>(6, "");
}
String name = JOptionPane.showInputDialog(C.I18N.getString("请输入该旧版本的名称"));
file = new File(Utils.addSeparator(SettingsManager.settings.publicSettings.gameDir)
+ "versions" + File.separator + name);
if (file.exists()) {
//MessageBox.Show(C.I18N.getString("找到同名的MINECRAFT版本,请换用另一个名称"));
return new ControllerAction<String>(7, "");
}
MinecraftOldVersionIncluder l = new MinecraftOldVersionIncluder(mcp, name);
l.include();
return new ControllerAction<String>(4, "");
} catch (Exception e) {
//MessageBox.Show(
// java.text.MessageFormat.format(
// C.I18N.getString("导入失败: {0}"), new Object[]{e.getMessage()}));
return new ControllerAction<String>(0, e.getMessage());
}
}
}
@@ -0,0 +1,155 @@
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package org.jackhuang.hellominecraftlauncher.plugin;
import org.jackhuang.hellominecraftlauncher.plugin.editpanels.SaveWorldPanel;
import java.io.IOException;
import java.util.logging.Level;
import java.util.logging.Logger;
import org.jackhuang.hellominecraftlauncher.apis.Configuration;
import org.jackhuang.hellominecraftlauncher.apis.IMinecraftEnvironment;
import org.jackhuang.hellominecraftlauncher.apis.IPlugin;
import org.jackhuang.hellominecraftlauncher.apis.Plugin;
import org.jackhuang.hellominecraftlauncher.apis.PluginHandlerType;
import org.jackhuang.hellominecraftlauncher.apis.events.HMCLPluginLoadEvent;
import org.jackhuang.hellominecraftlauncher.apis.events.HMCLPluginUnloadEvent;
import org.jackhuang.hellominecraftlauncher.apis.events.HMCLPluginVersionChangedEvent;
import org.jackhuang.hellominecraftlauncher.apis.handlers.IAssetsHandler;
import org.jackhuang.hellominecraftlauncher.apis.handlers.Login;
import org.jackhuang.hellominecraftlauncher.plugin.editpanels.AssetsPanel;
import org.jackhuang.hellominecraftlauncher.plugin.editpanels.InstallersPanel;
import org.jackhuang.hellominecraftlauncher.plugin.editpanels.ServerEditPanel;
import org.jackhuang.hellominecraftlauncher.plugin.editpanels.TexturepackEditPanel;
import org.jackhuang.hellominecraftlauncher.plugin.logins.LegacyLogin;
import org.jackhuang.hellominecraftlauncher.plugin.logins.LoginPluginSettings;
import org.jackhuang.hellominecraftlauncher.plugin.logins.MineLogin;
import org.jackhuang.hellominecraftlauncher.plugin.logins.OfflineLogin;
import org.jackhuang.hellominecraftlauncher.plugin.logins.SkinmeLogin;
import org.jackhuang.hellominecraftlauncher.plugin.logins.YggdrasilLogin;
import org.jackhuang.hellominecraftlauncher.plugin.mainpanels.GameDownloadPanel;
import org.jackhuang.hellominecraftlauncher.plugin.mainpanels.IntegrateDownloadPanel;
import org.jackhuang.hellominecraftlauncher.plugin.settings.AssetsMojangLoader;
import org.jackhuang.hellominecraftlauncher.plugin.settings.AssetsMojangOldLoader;
import org.jackhuang.hellominecraftlauncher.plugin.settings.AssetsZipHandler;
import org.jackhuang.hellominecraftlauncher.utilities.C;
/**
*
* @author hyh
*/
@Plugin(apiVer = 1, pluginVer = "1.9.4", pluginId = "hmcl", pluginName = "Hello Minecraft! Launcher",
authors = "huangyuhui", description = "Too many features.", requires = {})
public class HMCLPlugin extends IPlugin {
YggdrasilLogin yggdrasilLogin;
LegacyLogin legacyLogin;
OfflineLogin offlineLogin;
SkinmeLogin skinmeLogin;
MineLogin mineLogin;
Configuration<LoginPluginSettings> config;
public static IMinecraftEnvironment env;
//assets handlers
AssetsZipHandler assets17, assets174, assets173, assets16;
AssetsMojangLoader assetsMojang;
AssetsMojangLoader assetsBMCL;
AssetsMojangOldLoader assetsOldBMCL;
//Version edit panels
SaveWorldPanel saveWorldPanel;
ServerEditPanel serverEditPanel;
TexturepackEditPanel texturepackEditPanel;
InstallersPanel installersPanel;
AssetsPanel assetsPanel;
//Main panels
IntegrateDownloadPanel integrateDownloadPanel;
GameDownloadPanel gameDownloadPanel;
@Override
public void load(HMCLPluginLoadEvent event) {
PluginHandlerType.registerPluginHandlerType("ASSETS", IAssetsHandler.class);
PluginHandlerType.registerPluginHandlerType("LOGIN", Login.class);
String clientToken = event.getMinecraftEnvironment().clientToken();
PluginHandlerType login = PluginHandlerType.getType("LOGIN");
event.getPluginRegister().registerPluginHandler(login,
offlineLogin = new OfflineLogin(clientToken));
event.getPluginRegister().registerPluginHandler(login,
yggdrasilLogin = new YggdrasilLogin(clientToken));
event.getPluginRegister().registerPluginHandler(login,
legacyLogin = new LegacyLogin(clientToken));
event.getPluginRegister().registerPluginHandler(login,
skinmeLogin = new SkinmeLogin(clientToken));
event.getPluginRegister().registerPluginHandler(login,
mineLogin = new MineLogin(clientToken));
config = new Configuration<LoginPluginSettings>(event.getSuggestedConfigurationFile());
config.load(LoginPluginSettings.class);
if(config.get() != null) {
legacyLogin.onLoadSettings(config.get().legacy);
yggdrasilLogin.onLoadSettings(config.get().yggdrasil);
}
env = event.getMinecraftEnvironment();
assets174 = new AssetsZipHandler("1.7.4(googlecode)", "assets-175.zip", "http://hmcl.googlecode.com/svn/trunk/assets-175.zip");
assets173 = new AssetsZipHandler("1.7.3(googlecode)", "assets-174.zip", "http://hmcl.googlecode.com/svn/trunk/assets-174.zip");
assets17 = new AssetsZipHandler("1.7.2(googlecode)", "assets-173.zip", "http://hmcl.googlecode.com/svn/trunk/assets-173.zip");
assets16 = new AssetsZipHandler("1.6(googlecode)", "assets-164.zip", "http://hmcl.googlecode.com/svn/trunk/assets-164.zip");
assetsMojang = new AssetsMojangLoader(C.URL_ASSETS_MOJANG, "1.7.4(Mojang)");
assetsBMCL = new AssetsMojangLoader(C.URL_ASSETS_BMCL, "1.7.4(BMCL)");
assetsOldBMCL = new AssetsMojangOldLoader(C.URL_OLD_ASSETS_BMCL, "1.6(BMCL)");
PluginHandlerType assets = PluginHandlerType.getType("ASSETS");
event.getPluginRegister().registerPluginHandler(assets, assets174);
event.getPluginRegister().registerPluginHandler(assets, assets173);
event.getPluginRegister().registerPluginHandler(assets, assets17);
event.getPluginRegister().registerPluginHandler(assets, assets16);
event.getPluginRegister().registerPluginHandler(assets, assetsMojang);
event.getPluginRegister().registerPluginHandler(assets, assetsBMCL);
event.getPluginRegister().registerPluginHandler(assets, assetsOldBMCL);
saveWorldPanel = new SaveWorldPanel();
serverEditPanel = new ServerEditPanel();
texturepackEditPanel = new TexturepackEditPanel();
installersPanel = new InstallersPanel();
assetsPanel = new AssetsPanel();
assetsPanel.assetsType = config.get().assetsType;
assetsPanel.prepareAssets();
event.getUIRegister().addPanelToVersionEdit(saveWorldPanel);
event.getUIRegister().addPanelToVersionEdit(serverEditPanel);
event.getUIRegister().addPanelToVersionEdit(texturepackEditPanel);
event.getUIRegister().addPanelToVersionEdit(installersPanel);
event.getUIRegister().addPanelToVersionEdit(assetsPanel);
integrateDownloadPanel = new IntegrateDownloadPanel();
gameDownloadPanel = new GameDownloadPanel();
event.getUIRegister().addPanelToMain(gameDownloadPanel);
event.getUIRegister().addPanelToMain(integrateDownloadPanel);
}
@Override
public void unload(HMCLPluginUnloadEvent event) {
LoginPluginSettings s = new LoginPluginSettings();
s.legacy = legacyLogin.onSaveSettings();
s.yggdrasil = yggdrasilLogin.onSaveSettings();
s.assetsType = assetsPanel.assetsType;
config.set(s);
try {
config.save();
} catch (IOException ex) {
Logger.getLogger(HMCLPlugin.class.getName()).log(Level.SEVERE, null, ex);
}
}
@Override
public void versionChanged(HMCLPluginVersionChangedEvent event) {
saveWorldPanel.loadSaves();
serverEditPanel.loadServers();
texturepackEditPanel.loadPacks();
installersPanel.reloadForgeList();
installersPanel.reloadOptifineList();
}
}
@@ -0,0 +1,46 @@
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package org.jackhuang.hellominecraftlauncher.plugin;
import java.io.File;
import org.jackhuang.hellominecraftlauncher.apis.IMinecraftEnvironment;
import org.jackhuang.hellominecraftlauncher.apis.utils.MinecraftVersionRequest;
import org.jackhuang.hellominecraftlauncher.apis.utils.Utils;
import org.jackhuang.hellominecraftlauncher.utilities.SettingsManager;
import org.jackhuang.hellominecraftlauncher.settings.Version;
import org.jackhuang.hellominecraftlauncher.views.MainWindow;
/**
*
* @author hyh
*/
public class MinecraftEnvironment implements IMinecraftEnvironment {
@Override
public String clientToken() {
return SettingsManager.settings.clientToken;
}
@Override
public Version getVersion() {
return MainWindow.getInstance().getVersion();
}
@Override
public String getDefaultGameDir() {
return SettingsManager.settings.publicSettings.gameDir;
}
@Override
public MinecraftVersionRequest getMinecraftVersion() {
return Utils.minecraftVersion(new File(getVersion().getMinecraftJar()));
}
@Override
public int getSourceType() {
return SettingsManager.settings.downloadtype;
}
}
@@ -0,0 +1,80 @@
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package org.jackhuang.hellominecraftlauncher.plugin;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.swing.JMenuItem;
import javax.swing.JPanel;
import org.jackhuang.hellominecraftlauncher.apis.IPluginHandler;
import org.jackhuang.hellominecraftlauncher.apis.IPluginRegister;
import org.jackhuang.hellominecraftlauncher.apis.IUIRegister;
import org.jackhuang.hellominecraftlauncher.apis.PluginHandlerType;
/**
*
* @author hyh
*/
public class PluginHandler implements IPluginRegister, IUIRegister {
@Override
public void registerPluginHandler(PluginHandlerType type, IPluginHandler handler) {
if(!type.claSS.isInstance(handler)) {
System.out.println("Error plugin handler, type: " + type.name);
return;
}
if(!pluginHandlers.containsKey(type))
pluginHandlers.put(type, new ArrayList<IPluginHandler>());
pluginHandlers.get(type).add(handler);
}
private static Map<PluginHandlerType, List<IPluginHandler>> pluginHandlers;
public static List<IPluginHandler> getPluginHandlers(PluginHandlerType type) {
if(!pluginHandlers.containsKey(type))
pluginHandlers.put(type, new ArrayList<IPluginHandler>());
return pluginHandlers.get(type);
}
static {
pluginHandlers = new HashMap<PluginHandlerType, List<IPluginHandler>>();
mainPanels = new ArrayList<JPanel>();
editPanels = new ArrayList<JPanel>();
operationsMenuItems = new ArrayList<JMenuItem>();
managingsMenuItems = new ArrayList<JMenuItem>();
importingsMenuItems = new ArrayList<JMenuItem>();
}
@Override
public void addPanelToMain(JPanel panel) {
mainPanels.add(panel);
}
@Override
public void addPanelToVersionEdit(JPanel panel) {
editPanels.add(panel);
}
public static ArrayList<JPanel> mainPanels, editPanels;
public static ArrayList<JMenuItem> operationsMenuItems, importingsMenuItems, managingsMenuItems;
@Override
public void addMenuItemToVersionOperations(JMenuItem menuItem) {
operationsMenuItems.add(menuItem);
}
@Override
public void addMenuItemToVersionImportings(JMenuItem menuItem) {
importingsMenuItems.add(menuItem);
}
@Override
public void addMenuItemToVersionManagings(JMenuItem menuItem) {
managingsMenuItems.add(menuItem);
}
}
@@ -0,0 +1,157 @@
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package org.jackhuang.hellominecraftlauncher.plugin;
import java.io.File;
import java.io.IOException;
import java.lang.reflect.Constructor;
import java.net.MalformedURLException;
import java.net.URL;
import java.net.URLClassLoader;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Enumeration;
import java.util.jar.JarEntry;
import java.util.jar.JarFile;
import java.util.logging.Level;
import java.util.logging.Logger;
import org.jackhuang.hellominecraftlauncher.Main;
import org.jackhuang.hellominecraftlauncher.apis.IPlugin;
import org.jackhuang.hellominecraftlauncher.apis.IPluginHandler;
import org.jackhuang.hellominecraftlauncher.apis.utils.Utils;
import org.jackhuang.hellominecraftlauncher.views.MainWindow;
import org.jackhuang.hellominecraftlauncher.apis.Plugin;
import org.jackhuang.hellominecraftlauncher.apis.PluginHandlerType;
import org.jackhuang.hellominecraftlauncher.apis.events.HMCLPluginLoadEvent;
import org.jackhuang.hellominecraftlauncher.apis.handlers.IAssetsHandler;
import org.jackhuang.hellominecraftlauncher.utilities.C;
import org.jackhuang.hellominecraftlauncher.settings.Version;
import org.jackhuang.hellominecraftlauncher.utilities.SettingsManager;
/**
*
* @author hyh
*/
public class PluginManager {
public static void preparePlugins() throws IOException {
String s = Utils.addSeparator(Utils.currentDir()) + C.FILE_PLUGINS + File.separator;
ArrayList<String> jars = Utils.findAllFileWithFullName(new File(s));
File[] files = new File[jars.size()];
URL[] urls = new URL[jars.size()];
URL temp;
pluginFiles = new ArrayList<JarFile>();
for (int j = 0; j < jars.size(); j++) {
try {
files[j] = new File(jars.get(j));
if(files[j].isDirectory()) continue;
temp = files[j].toURI().toURL();
urls[j] = temp;
pluginFiles.add(new JarFile(files[j]));
} catch (MalformedURLException ex) {
Logger.getLogger(MainWindow.class.getName()).log(Level.SEVERE, null, ex);
}
}
URLClassLoader loader = new URLClassLoader(urls);
plugins = new ArrayList<IPlugin>();
pluginAnnotations = new ArrayList<Plugin>();
pluginAnnotations.add(HMCLPlugin.class.getAnnotation(Plugin.class));
plugins.add(new HMCLPlugin());
for (int i = 0; i < pluginFiles.size(); i++) {
Enumeration<JarEntry> entries = pluginFiles.get(i).entries();
while(entries.hasMoreElements()) {
try {
JarEntry jarEntry = entries.nextElement();
String clsName = jarEntry.getName();
if(!clsName.endsWith(".class")) continue;
if(clsName.contains("$")) continue;
clsName = clsName.replace("/", ".");
clsName = clsName.replace(".class", "");
Class c = loader.loadClass(clsName);
if(c.isAnnotationPresent(Plugin.class)) {
Plugin p = (Plugin)c.getAnnotation(Plugin.class);
if(p.apiVer() > Main.pluginVersion)
continue;
IPlugin plugin = (IPlugin) c.newInstance();
if (plugin != null) {
pluginAnnotations.add(p);
plugins.add(plugin);
}
}
} catch (Throwable ex) {
Logger.getLogger(MainWindow.class.getName()).log(Level.SEVERE, null, ex);
}
}
}
preparedPlugins = true;
}
public static void loadPlugin() {
if(!preparedPlugins) return;
pluginError = new ArrayList<String>();
PluginHandler ph = new PluginHandler();
MinecraftEnvironment me = new MinecraftEnvironment();
for(int i = 0; i < plugins.size(); i++) {
IPlugin l = plugins.get(i);
Plugin p = pluginAnnotations.get(i);
try {
l.load(new HMCLPluginLoadEvent(ph, ph, me,
Utils.addSeparator(Utils.currentDir()) + C.FILE_PLUGINS +
File.separator + "config" + File.separator +
p.pluginId() + ".json"));
pluginError.add(null);
} catch(Exception e) {
pluginError.add(Utils.makeStackTrace(e));
}
}
}
public static void unloadPlugin() {
if(!preparedPlugins) return;
for(IPlugin l : plugins) {
l.unload(null);
}
plugins = null;
pluginFiles = null;
pluginAnnotations = null;
pluginError = null;
preparedPlugins = false;
}
public static void versionChanged() {
for(IPlugin p : PluginManager.plugins) {
try {
p.versionChanged(null);
} catch(Throwable t) {
t.printStackTrace();
}
}
Version v = MainWindow.getInstance().getVersion(false);
String assets = v.gameAssets;
if(Utils.isEmpty(assets))
assets = Utils.getGameDir(v, SettingsManager.settings.publicSettings.gameDir) + "assets";
for(IPluginHandler ph : PluginHandler.getPluginHandlers(PluginHandlerType.getType("ASSETS"))) {
try {
IAssetsHandler ah = (IAssetsHandler) ph;
ah.setAssets(assets);
} catch(Exception e) {
}
}
}
public static void showSettingsDialog(int ind) {
plugins.get(ind).showSettingsDialog();
}
public static boolean preparedPlugins = false;
public static ArrayList<IPlugin> plugins;
public static ArrayList<Plugin> pluginAnnotations;
public static ArrayList<JarFile> pluginFiles;
public static ArrayList<String> pluginError;
}
@@ -0,0 +1,137 @@
<?xml version="1.0" encoding="UTF-8" ?>
<Form version="1.3" maxVersion="1.8" type="org.netbeans.modules.form.forminfo.JPanelFormInfo">
<AuxValues>
<AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="0"/>
<AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/>
<AuxValue name="FormSettings_generateFQN" type="java.lang.Boolean" value="true"/>
<AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="false"/>
<AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="false"/>
<AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="1"/>
<AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/>
<AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/>
<AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/>
</AuxValues>
<Layout>
<DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0">
<EmptySpace min="0" pref="406" max="32767" attributes="0"/>
<Group type="103" rootIndex="1" groupAlignment="0" attributes="0">
<Component id="jPanel12" alignment="0" max="32767" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
<DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0">
<EmptySpace min="0" pref="319" max="32767" attributes="0"/>
<Group type="103" rootIndex="1" groupAlignment="0" attributes="0">
<Component id="jPanel12" alignment="0" max="32767" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
</Layout>
<SubComponents>
<Container class="javax.swing.JPanel" name="jPanel12">
<Layout>
<DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<Component id="jScrollPane8" pref="306" max="32767" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="1" attributes="0">
<Component id="jLabel5" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="cboAssetsType" min="-2" max="-2" attributes="0"/>
</Group>
<Group type="103" alignment="1" groupAlignment="0" max="-2" attributes="0">
<Component id="jButton4" alignment="1" max="32767" attributes="0"/>
<Component id="btnDownloadAllAssets" alignment="1" max="32767" attributes="0"/>
</Group>
</Group>
<EmptySpace max="-2" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
<DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="jLabel5" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="cboAssetsType" alignment="3" min="-2" pref="26" max="-2" attributes="0"/>
</Group>
<EmptySpace max="-2" attributes="0"/>
<Component id="btnDownloadAllAssets" min="-2" max="-2" attributes="0"/>
<EmptySpace min="-2" pref="8" max="-2" attributes="0"/>
<Component id="jButton4" min="-2" max="-2" attributes="0"/>
<EmptySpace max="32767" attributes="0"/>
</Group>
<Component id="jScrollPane8" alignment="0" pref="319" max="32767" attributes="0"/>
</Group>
</DimensionLayout>
</Layout>
<SubComponents>
<Container class="javax.swing.JScrollPane" name="jScrollPane8">
<AuxValues>
<AuxValue name="autoScrollPane" type="java.lang.Boolean" value="true"/>
</AuxValues>
<Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/>
<SubComponents>
<Component class="javax.swing.JList" name="lstAssets">
<Properties>
<Property name="model" type="javax.swing.ListModel" editor="org.netbeans.modules.form.editors2.ListModelEditor">
<StringArray count="0"/>
</Property>
</Properties>
</Component>
</SubComponents>
</Container>
<Component class="javax.swing.JButton" name="btnDownloadAllAssets">
<Properties>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="org/jackhuang/hellominecraftlauncher/I18N.properties" key="&#x5168;&#x90e8;&#x4e0b;&#x8f7d;" replaceFormat="java.util.ResourceBundle.getBundle(&quot;{bundleNameSlashes}&quot;).getString(&quot;{key}&quot;)"/>
</Property>
<Property name="toolTipText" type="java.lang.String" value=""/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnDownloadAllAssetsActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JButton" name="jButton4">
<Properties>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="org/jackhuang/hellominecraftlauncher/I18N.properties" key="&#x5237;&#x65b0;" replaceFormat="java.util.ResourceBundle.getBundle(&quot;{bundleNameSlashes}&quot;).getString(&quot;{key}&quot;)"/>
</Property>
<Property name="toolTipText" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="org/jackhuang/hellominecraftlauncher/I18N.properties" key="Refresh" replaceFormat="java.util.ResourceBundle.getBundle(&quot;{bundleNameSlashes}&quot;).getString(&quot;{key}&quot;)"/>
</Property>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jButton4ActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JLabel" name="jLabel5">
<Properties>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="org/jackhuang/hellominecraftlauncher/I18N.properties" key="AssetsType" replaceFormat="java.util.ResourceBundle.getBundle(&quot;{bundleNameSlashes}&quot;).getString(&quot;{key}&quot;)"/>
</Property>
</Properties>
</Component>
<Component class="javax.swing.JComboBox" name="cboAssetsType">
<Properties>
<Property name="model" type="javax.swing.ComboBoxModel" editor="org.netbeans.modules.form.editors2.ComboBoxModelEditor">
<StringArray count="0"/>
</Property>
</Properties>
<Events>
<EventHandler event="itemStateChanged" listener="java.awt.event.ItemListener" parameters="java.awt.event.ItemEvent" handler="cboAssetsTypeItemStateChanged"/>
</Events>
</Component>
</SubComponents>
</Container>
</SubComponents>
</Form>
@@ -0,0 +1,194 @@
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package org.jackhuang.hellominecraftlauncher.plugin.editpanels;
import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.DefaultListModel;
import org.jackhuang.hellominecraftlauncher.apis.DoneListener;
import org.jackhuang.hellominecraftlauncher.apis.IPluginHandler;
import org.jackhuang.hellominecraftlauncher.apis.PluginHandlerType;
import org.jackhuang.hellominecraftlauncher.apis.handlers.IAssetsHandler;
import org.jackhuang.hellominecraftlauncher.apis.utils.MessageBox;
import org.jackhuang.hellominecraftlauncher.apis.utils.Utils;
import org.jackhuang.hellominecraftlauncher.plugin.PluginHandler;
import org.jackhuang.hellominecraftlauncher.utilities.C;
/**
*
* @author hyh
*/
public class AssetsPanel extends javax.swing.JPanel {
/**
* Creates new form AssetsPanel
*/
public AssetsPanel() {
initComponents();
setName(C.I18N.getString("AssetsDownload"));
}
public int assetsType;
/**
* This method is called from within the constructor to initialize the form.
* WARNING: Do NOT modify this code. The content of this method is always
* regenerated by the Form Editor.
*/
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
jPanel12 = new javax.swing.JPanel();
jScrollPane8 = new javax.swing.JScrollPane();
lstAssets = new javax.swing.JList();
btnDownloadAllAssets = new javax.swing.JButton();
jButton4 = new javax.swing.JButton();
jLabel5 = new javax.swing.JLabel();
cboAssetsType = new javax.swing.JComboBox();
jScrollPane8.setViewportView(lstAssets);
java.util.ResourceBundle bundle = java.util.ResourceBundle.getBundle("org/jackhuang/hellominecraftlauncher/I18N"); // NOI18N
btnDownloadAllAssets.setText(bundle.getString("全部下载")); // NOI18N
btnDownloadAllAssets.setToolTipText("");
btnDownloadAllAssets.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnDownloadAllAssetsActionPerformed(evt);
}
});
jButton4.setText(bundle.getString("刷新")); // NOI18N
jButton4.setToolTipText(bundle.getString("Refresh")); // NOI18N
jButton4.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton4ActionPerformed(evt);
}
});
jLabel5.setText(bundle.getString("AssetsType")); // NOI18N
cboAssetsType.addItemListener(new java.awt.event.ItemListener() {
public void itemStateChanged(java.awt.event.ItemEvent evt) {
cboAssetsTypeItemStateChanged(evt);
}
});
javax.swing.GroupLayout jPanel12Layout = new javax.swing.GroupLayout(jPanel12);
jPanel12.setLayout(jPanel12Layout);
jPanel12Layout.setHorizontalGroup(
jPanel12Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel12Layout.createSequentialGroup()
.addComponent(jScrollPane8, javax.swing.GroupLayout.DEFAULT_SIZE, 306, Short.MAX_VALUE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jPanel12Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel12Layout.createSequentialGroup()
.addComponent(jLabel5)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(cboAssetsType, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel12Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
.addComponent(jButton4, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(btnDownloadAllAssets, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
.addContainerGap())
);
jPanel12Layout.setVerticalGroup(
jPanel12Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel12Layout.createSequentialGroup()
.addContainerGap()
.addGroup(jPanel12Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel5)
.addComponent(cboAssetsType, javax.swing.GroupLayout.PREFERRED_SIZE, 26, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(btnDownloadAllAssets)
.addGap(8, 8, 8)
.addComponent(jButton4)
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addComponent(jScrollPane8, javax.swing.GroupLayout.DEFAULT_SIZE, 319, Short.MAX_VALUE)
);
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
this.setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGap(0, 406, Short.MAX_VALUE)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jPanel12, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGap(0, 319, Short.MAX_VALUE)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jPanel12, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
}// </editor-fold>//GEN-END:initComponents
private void btnDownloadAllAssetsActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnDownloadAllAssetsActionPerformed
downloadAssets(cboAssetsType.getSelectedIndex());
}//GEN-LAST:event_btnDownloadAllAssetsActionPerformed
private void jButton4ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton4ActionPerformed
loadAssets(cboAssetsType.getSelectedIndex(), true);
}//GEN-LAST:event_jButton4ActionPerformed
private void cboAssetsTypeItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_cboAssetsTypeItemStateChanged
if (cboAssetsType.getSelectedIndex() != -1 && !Utils.isEmpty((String) cboAssetsType.getSelectedItem())) {
assetsType = cboAssetsType.getSelectedIndex();
loadAssets(cboAssetsType.getSelectedIndex(), true);
}
}//GEN-LAST:event_cboAssetsTypeItemStateChanged
private void downloadAssets(int type) {
List<IPluginHandler> list = PluginHandler.getPluginHandlers(PluginHandlerType.getType("ASSETS"));
IAssetsHandler ah = (IAssetsHandler) list.get(type);
ah.beginDownloading();
}
private void loadAssets(int type, boolean isUser) {
lstAssets.setModel(lstAssetsModel);
lstAssetsModel.clear();
List<IPluginHandler> list = PluginHandler.getPluginHandlers(PluginHandlerType.getType("ASSETS"));
IAssetsHandler ah = (IAssetsHandler) list.get(type);
ah.getList(new DoneListener<String[], Void>() {
@Override
public void onDone(String[] value, Void value2) {
for(String s : value) {
lstAssetsModel.addElement(s);
}
lstAssets.updateUI();
}
});
}
public void prepareAssets() {
List<IPluginHandler> list = PluginHandler.getPluginHandlers(PluginHandlerType.getType("ASSETS"));
for (IPluginHandler str : list) {
try {
IAssetsHandler ah = (IAssetsHandler)str;
cboAssetsType.addItem(ah.getName());
} catch (Exception ex) {
Logger.getLogger(AssetsPanel.class.getName()).log(Level.SEVERE, null, ex);
MessageBox.Show(java.util.ResourceBundle.getBundle("org/jackhuang/hellominecraftlauncher/I18N").getString("CannotLoadPluginsBecauseOfAnError"));
}
}
if (assetsType < list.size()) {
cboAssetsType.setSelectedIndex(assetsType);
}
}
DefaultListModel lstAssetsModel = new DefaultListModel();
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JButton btnDownloadAllAssets;
private javax.swing.JComboBox cboAssetsType;
private javax.swing.JButton jButton4;
private javax.swing.JLabel jLabel5;
private javax.swing.JPanel jPanel12;
private javax.swing.JScrollPane jScrollPane8;
private javax.swing.JList lstAssets;
// End of variables declaration//GEN-END:variables
}
@@ -0,0 +1,341 @@
<?xml version="1.0" encoding="UTF-8" ?>
<Form version="1.6" maxVersion="1.8" type="org.netbeans.modules.form.forminfo.JPanelFormInfo">
<Properties>
<Property name="name" type="java.lang.String" value="" noResource="true"/>
</Properties>
<AuxValues>
<AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="0"/>
<AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/>
<AuxValue name="FormSettings_generateFQN" type="java.lang.Boolean" value="true"/>
<AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="false"/>
<AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="false"/>
<AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="1"/>
<AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/>
<AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/>
<AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/>
</AuxValues>
<Layout>
<DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0">
<EmptySpace min="0" pref="430" max="32767" attributes="0"/>
<Group type="103" rootIndex="1" groupAlignment="0" attributes="0">
<Component id="jPanel15" alignment="0" max="32767" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
<DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0">
<EmptySpace min="0" pref="319" max="32767" attributes="0"/>
<Group type="103" rootIndex="1" groupAlignment="0" attributes="0">
<Component id="jPanel15" alignment="0" max="32767" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
</Layout>
<SubComponents>
<Container class="javax.swing.JPanel" name="jPanel15">
<Layout>
<DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="1" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Component id="jTabbedPane4" max="32767" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
<DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="1" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Component id="jTabbedPane4" max="32767" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
</Layout>
<SubComponents>
<Container class="javax.swing.JTabbedPane" name="jTabbedPane4">
<Layout class="org.netbeans.modules.form.compat2.layouts.support.JTabbedPaneSupportLayout"/>
<SubComponents>
<Container class="javax.swing.JPanel" name="jPanel16">
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.support.JTabbedPaneSupportLayout" value="org.netbeans.modules.form.compat2.layouts.support.JTabbedPaneSupportLayout$JTabbedPaneConstraintsDescription">
<JTabbedPaneConstraints tabName="Forge">
<Property name="tabTitle" type="java.lang.String" value="Forge"/>
</JTabbedPaneConstraints>
</Constraint>
</Constraints>
<Layout>
<DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Component id="jScrollPane11" pref="235" max="32767" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" max="-2" attributes="0">
<Component id="jLabel12" alignment="0" min="-2" max="-2" attributes="0"/>
<Component id="btnForgeChangeLog" alignment="1" max="32767" attributes="0"/>
<Group type="102" alignment="1" attributes="0">
<Component id="btnRefreshForge" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="btnDownloadForge" min="-2" max="-2" attributes="0"/>
</Group>
<Component id="jScrollPane12" alignment="1" pref="0" max="32767" attributes="0"/>
</Group>
<EmptySpace max="-2" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
<DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<Group type="103" groupAlignment="3" attributes="0">
<Component id="btnRefreshForge" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="btnDownloadForge" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace max="-2" attributes="0"/>
<Component id="btnForgeChangeLog" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="jLabel12" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="jScrollPane12" max="32767" attributes="0"/>
</Group>
<Component id="jScrollPane11" alignment="0" pref="250" max="32767" attributes="0"/>
</Group>
<EmptySpace max="-2" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
</Layout>
<SubComponents>
<Container class="javax.swing.JScrollPane" name="jScrollPane11">
<AuxValues>
<AuxValue name="autoScrollPane" type="java.lang.Boolean" value="true"/>
</AuxValues>
<Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/>
<SubComponents>
<Component class="javax.swing.JTable" name="lstForge">
<Properties>
<Property name="model" type="javax.swing.table.TableModel" editor="org.netbeans.modules.form.editors2.TableModelEditor">
<Table columnCount="4" rowCount="0">
<Column editable="false" title="&#x7c7b;&#x578b;" type="java.lang.String"/>
<Column editable="false" title="Forge&#x7248;&#x672c;" type="java.lang.String"/>
<Column editable="false" title="Minecraft&#x7248;&#x672c;" type="java.lang.String"/>
<Column editable="false" title="&#x65f6;&#x95f4;" type="java.lang.String"/>
</Table>
</Property>
<Property name="selectionModel" type="javax.swing.ListSelectionModel" editor="org.netbeans.modules.form.editors2.JTableSelectionModelEditor">
<JTableSelectionModel selectionMode="0"/>
</Property>
<Property name="tableHeader" type="javax.swing.table.JTableHeader" editor="org.netbeans.modules.form.editors2.JTableHeaderEditor">
<TableHeader reorderingAllowed="true" resizingAllowed="true"/>
</Property>
</Properties>
</Component>
</SubComponents>
</Container>
<Component class="javax.swing.JButton" name="btnRefreshForge">
<Properties>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="org/jackhuang/hellominecraftlauncher/I18N.properties" key="Refresh" replaceFormat="java.util.ResourceBundle.getBundle(&quot;{bundleNameSlashes}&quot;).getString(&quot;{key}&quot;)"/>
</Property>
<Property name="toolTipText" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="org/jackhuang/hellominecraftlauncher/I18N.properties" key="Refresh" replaceFormat="java.util.ResourceBundle.getBundle(&quot;{bundleNameSlashes}&quot;).getString(&quot;{key}&quot;)"/>
</Property>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnRefreshForgeActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JButton" name="btnDownloadForge">
<Properties>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="org/jackhuang/hellominecraftlauncher/I18N.properties" key="Install" replaceFormat="java.util.ResourceBundle.getBundle(&quot;{bundleNameSlashes}&quot;).getString(&quot;{key}&quot;)"/>
</Property>
<Property name="toolTipText" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="org/jackhuang/hellominecraftlauncher/I18N.properties" key="InstallForge" replaceFormat="java.util.ResourceBundle.getBundle(&quot;{bundleNameSlashes}&quot;).getString(&quot;{key}&quot;)"/>
</Property>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnDownloadForgeActionPerformed"/>
</Events>
</Component>
<Container class="javax.swing.JScrollPane" name="jScrollPane12">
<AuxValues>
<AuxValue name="autoScrollPane" type="java.lang.Boolean" value="true"/>
</AuxValues>
<Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/>
<SubComponents>
<Component class="javax.swing.JTextArea" name="txtForge">
<Properties>
<Property name="columns" type="int" value="20"/>
<Property name="rows" type="int" value="5"/>
</Properties>
</Component>
</SubComponents>
</Container>
<Component class="javax.swing.JLabel" name="jLabel12">
<Properties>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="org/jackhuang/hellominecraftlauncher/I18N.properties" key="&#x4e0b;&#x8f7d;&#x4fe1;&#x606f;" replaceFormat="java.util.ResourceBundle.getBundle(&quot;{bundleNameSlashes}&quot;).getString(&quot;{key}&quot;)"/>
</Property>
</Properties>
</Component>
<Component class="javax.swing.JButton" name="btnForgeChangeLog">
<Properties>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="org/jackhuang/hellominecraftlauncher/I18N.properties" key="Changelog" replaceFormat="java.util.ResourceBundle.getBundle(&quot;{bundleNameSlashes}&quot;).getString(&quot;{key}&quot;)"/>
</Property>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnForgeChangeLogActionPerformed"/>
</Events>
</Component>
</SubComponents>
</Container>
<Container class="javax.swing.JPanel" name="jPanel17">
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.support.JTabbedPaneSupportLayout" value="org.netbeans.modules.form.compat2.layouts.support.JTabbedPaneSupportLayout$JTabbedPaneConstraintsDescription">
<JTabbedPaneConstraints tabName="OptiFine">
<Property name="tabTitle" type="java.lang.String" value="OptiFine"/>
</JTabbedPaneConstraints>
</Constraint>
</Constraints>
<Layout>
<DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Component id="jScrollPane13" pref="259" max="32767" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" max="-2" attributes="0">
<Component id="jScrollPane14" alignment="1" pref="0" max="32767" attributes="0"/>
<Component id="jLabel20" alignment="0" min="-2" max="-2" attributes="0"/>
<Group type="102" alignment="0" attributes="0">
<Component id="btnRefreshOptifine" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="btnDownloadOptifine" min="-2" max="-2" attributes="0"/>
</Group>
</Group>
<EmptySpace max="-2" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
<DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<Group type="103" groupAlignment="3" attributes="0">
<Component id="btnRefreshOptifine" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="btnDownloadOptifine" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace max="-2" attributes="0"/>
<Component id="jLabel20" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="jScrollPane14" pref="200" max="32767" attributes="0"/>
</Group>
<Component id="jScrollPane13" alignment="0" pref="0" max="32767" attributes="0"/>
</Group>
<EmptySpace max="-2" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
</Layout>
<SubComponents>
<Container class="javax.swing.JScrollPane" name="jScrollPane13">
<AuxValues>
<AuxValue name="autoScrollPane" type="java.lang.Boolean" value="true"/>
</AuxValues>
<Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/>
<SubComponents>
<Component class="javax.swing.JTable" name="lstOptifine">
<Properties>
<Property name="model" type="javax.swing.table.TableModel" editor="org.netbeans.modules.form.editors2.TableModelEditor">
<Table columnCount="4" rowCount="0">
<Column editable="false" title="&#x7c7b;&#x578b;" type="java.lang.String"/>
<Column editable="false" title="Optifine&#x7248;&#x672c;" type="java.lang.String"/>
<Column editable="false" title="Minecraft&#x7248;&#x672c;" type="java.lang.String"/>
<Column editable="false" title="&#x65f6;&#x95f4;" type="java.lang.String"/>
</Table>
</Property>
<Property name="selectionModel" type="javax.swing.ListSelectionModel" editor="org.netbeans.modules.form.editors2.JTableSelectionModelEditor">
<JTableSelectionModel selectionMode="0"/>
</Property>
<Property name="tableHeader" type="javax.swing.table.JTableHeader" editor="org.netbeans.modules.form.editors2.JTableHeaderEditor">
<TableHeader reorderingAllowed="true" resizingAllowed="true"/>
</Property>
</Properties>
</Component>
</SubComponents>
</Container>
<Component class="javax.swing.JButton" name="btnRefreshOptifine">
<Properties>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="org/jackhuang/hellominecraftlauncher/I18N.properties" key="&#x5237;&#x65b0;" replaceFormat="java.util.ResourceBundle.getBundle(&quot;{bundleNameSlashes}&quot;).getString(&quot;{key}&quot;)"/>
</Property>
<Property name="toolTipText" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="org/jackhuang/hellominecraftlauncher/I18N.properties" key="Refresh" replaceFormat="java.util.ResourceBundle.getBundle(&quot;{bundleNameSlashes}&quot;).getString(&quot;{key}&quot;)"/>
</Property>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnRefreshOptifineActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JButton" name="btnDownloadOptifine">
<Properties>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="org/jackhuang/hellominecraftlauncher/I18N.properties" key="&#x5b89;&#x88c5;" replaceFormat="java.util.ResourceBundle.getBundle(&quot;{bundleNameSlashes}&quot;).getString(&quot;{key}&quot;)"/>
</Property>
<Property name="toolTipText" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="org/jackhuang/hellominecraftlauncher/I18N.properties" key="InstallOptifine" replaceFormat="java.util.ResourceBundle.getBundle(&quot;{bundleNameSlashes}&quot;).getString(&quot;{key}&quot;)"/>
</Property>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnDownloadOptifineActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JLabel" name="jLabel20">
<Properties>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="org/jackhuang/hellominecraftlauncher/I18N.properties" key="&#x4e0b;&#x8f7d;&#x4fe1;&#x606f;" replaceFormat="java.util.ResourceBundle.getBundle(&quot;{bundleNameSlashes}&quot;).getString(&quot;{key}&quot;)"/>
</Property>
</Properties>
</Component>
<Container class="javax.swing.JScrollPane" name="jScrollPane14">
<AuxValues>
<AuxValue name="autoScrollPane" type="java.lang.Boolean" value="true"/>
</AuxValues>
<Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/>
<SubComponents>
<Component class="javax.swing.JTextArea" name="txtOptifine">
<Properties>
<Property name="columns" type="int" value="20"/>
<Property name="rows" type="int" value="5"/>
</Properties>
</Component>
</SubComponents>
</Container>
</SubComponents>
</Container>
</SubComponents>
</Container>
</SubComponents>
</Container>
</SubComponents>
</Form>
@@ -0,0 +1,611 @@
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package org.jackhuang.hellominecraftlauncher.plugin.editpanels;
import java.awt.Toolkit;
import java.awt.datatransfer.Clipboard;
import java.awt.datatransfer.StringSelection;
import java.awt.datatransfer.Transferable;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.table.DefaultTableModel;
import org.jackhuang.hellominecraftlauncher.JavaProcess;
import org.jackhuang.hellominecraftlauncher.apis.DoneListener;
import org.jackhuang.hellominecraftlauncher.apis.DownloadWindow;
import org.jackhuang.hellominecraftlauncher.apis.utils.MessageBox;
import org.jackhuang.hellominecraftlauncher.apis.utils.Utils;
import org.jackhuang.hellominecraftlauncher.download.URLGet;
import org.jackhuang.hellominecraftlauncher.installers.forge.BaseLauncherProfile;
import org.jackhuang.hellominecraftlauncher.installers.forge.ForgeFormatThread;
import org.jackhuang.hellominecraftlauncher.installers.forge.ForgeOldInstaller;
import org.jackhuang.hellominecraftlauncher.installers.forge.ForgeVersion;
import org.jackhuang.hellominecraftlauncher.installers.optifine.OptifineFormatDownloadThread;
import org.jackhuang.hellominecraftlauncher.installers.optifine.OptifineFormatThread;
import org.jackhuang.hellominecraftlauncher.installers.optifine.OptifineVersion;
import org.jackhuang.hellominecraftlauncher.plugin.HMCLPlugin;
import org.jackhuang.hellominecraftlauncher.utilities.C;
import org.jackhuang.hellominecraftlauncher.utilities.ProcessThread;
import org.jackhuang.hellominecraftlauncher.views.LogWindow;
/**
*
* @author hyh
*/
public class InstallersPanel extends javax.swing.JPanel {
/**
* Creates new form InstallersPanel
*/
public InstallersPanel() {
initComponents();
setName(C.I18N.getString("Installers"));
lstForge.setModel(Utils.makeDefaultTableModel(new String[]{C.I18N.getString("Type"), C.I18N.getString("Version"), C.I18N.getString("MCVersion"), C.I18N.getString("Time")},
new Class[]{String.class, String.class, String.class, String.class}, new boolean[]{false,false,false,false}));
lstOptifine.setModel(Utils.makeDefaultTableModel(new String[]{C.I18N.getString("Type"), C.I18N.getString("Version"), C.I18N.getString("MCVersion"), C.I18N.getString("Time")},
new Class[]{String.class, String.class, String.class, String.class}, new boolean[]{false,false,false,false}));
}
/**
* This method is called from within the constructor to initialize the form.
* WARNING: Do NOT modify this code. The content of this method is always
* regenerated by the Form Editor.
*/
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
jPanel15 = new javax.swing.JPanel();
jTabbedPane4 = new javax.swing.JTabbedPane();
jPanel16 = new javax.swing.JPanel();
jScrollPane11 = new javax.swing.JScrollPane();
lstForge = new javax.swing.JTable();
btnRefreshForge = new javax.swing.JButton();
btnDownloadForge = new javax.swing.JButton();
jScrollPane12 = new javax.swing.JScrollPane();
txtForge = new javax.swing.JTextArea();
jLabel12 = new javax.swing.JLabel();
btnForgeChangeLog = new javax.swing.JButton();
jPanel17 = new javax.swing.JPanel();
jScrollPane13 = new javax.swing.JScrollPane();
lstOptifine = new javax.swing.JTable();
btnRefreshOptifine = new javax.swing.JButton();
btnDownloadOptifine = new javax.swing.JButton();
jLabel20 = new javax.swing.JLabel();
jScrollPane14 = new javax.swing.JScrollPane();
txtOptifine = new javax.swing.JTextArea();
setName(""); // NOI18N
lstForge.setModel(new javax.swing.table.DefaultTableModel(
new Object [][] {
},
new String [] {
"类型", "Forge版本", "Minecraft版本", "时间"
}
) {
Class[] types = new Class [] {
java.lang.String.class, java.lang.String.class, java.lang.String.class, java.lang.String.class
};
boolean[] canEdit = new boolean [] {
false, false, false, false
};
public Class getColumnClass(int columnIndex) {
return types [columnIndex];
}
public boolean isCellEditable(int rowIndex, int columnIndex) {
return canEdit [columnIndex];
}
});
lstForge.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);
jScrollPane11.setViewportView(lstForge);
java.util.ResourceBundle bundle = java.util.ResourceBundle.getBundle("org/jackhuang/hellominecraftlauncher/I18N"); // NOI18N
btnRefreshForge.setText(bundle.getString("Refresh")); // NOI18N
btnRefreshForge.setToolTipText(bundle.getString("Refresh")); // NOI18N
btnRefreshForge.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnRefreshForgeActionPerformed(evt);
}
});
btnDownloadForge.setText(bundle.getString("Install")); // NOI18N
btnDownloadForge.setToolTipText(bundle.getString("InstallForge")); // NOI18N
btnDownloadForge.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnDownloadForgeActionPerformed(evt);
}
});
txtForge.setColumns(20);
txtForge.setRows(5);
jScrollPane12.setViewportView(txtForge);
jLabel12.setText(bundle.getString("下载信息")); // NOI18N
btnForgeChangeLog.setText(bundle.getString("Changelog")); // NOI18N
btnForgeChangeLog.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnForgeChangeLogActionPerformed(evt);
}
});
javax.swing.GroupLayout jPanel16Layout = new javax.swing.GroupLayout(jPanel16);
jPanel16.setLayout(jPanel16Layout);
jPanel16Layout.setHorizontalGroup(
jPanel16Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel16Layout.createSequentialGroup()
.addContainerGap()
.addComponent(jScrollPane11, javax.swing.GroupLayout.DEFAULT_SIZE, 235, Short.MAX_VALUE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jPanel16Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
.addComponent(jLabel12)
.addComponent(btnForgeChangeLog, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel16Layout.createSequentialGroup()
.addComponent(btnRefreshForge)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(btnDownloadForge))
.addComponent(jScrollPane12, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE))
.addContainerGap())
);
jPanel16Layout.setVerticalGroup(
jPanel16Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel16Layout.createSequentialGroup()
.addContainerGap()
.addGroup(jPanel16Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel16Layout.createSequentialGroup()
.addGroup(jPanel16Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(btnRefreshForge)
.addComponent(btnDownloadForge))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(btnForgeChangeLog)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jLabel12)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jScrollPane12))
.addComponent(jScrollPane11, javax.swing.GroupLayout.DEFAULT_SIZE, 250, Short.MAX_VALUE))
.addContainerGap())
);
jTabbedPane4.addTab("Forge", jPanel16);
lstOptifine.setModel(new javax.swing.table.DefaultTableModel(
new Object [][] {
},
new String [] {
"类型", "Optifine版本", "Minecraft版本", "时间"
}
) {
Class[] types = new Class [] {
java.lang.String.class, java.lang.String.class, java.lang.String.class, java.lang.String.class
};
boolean[] canEdit = new boolean [] {
false, false, false, false
};
public Class getColumnClass(int columnIndex) {
return types [columnIndex];
}
public boolean isCellEditable(int rowIndex, int columnIndex) {
return canEdit [columnIndex];
}
});
lstOptifine.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);
jScrollPane13.setViewportView(lstOptifine);
btnRefreshOptifine.setText(bundle.getString("刷新")); // NOI18N
btnRefreshOptifine.setToolTipText(bundle.getString("Refresh")); // NOI18N
btnRefreshOptifine.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnRefreshOptifineActionPerformed(evt);
}
});
btnDownloadOptifine.setText(bundle.getString("安装")); // NOI18N
btnDownloadOptifine.setToolTipText(bundle.getString("InstallOptifine")); // NOI18N
btnDownloadOptifine.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnDownloadOptifineActionPerformed(evt);
}
});
jLabel20.setText(bundle.getString("下载信息")); // NOI18N
txtOptifine.setColumns(20);
txtOptifine.setRows(5);
jScrollPane14.setViewportView(txtOptifine);
javax.swing.GroupLayout jPanel17Layout = new javax.swing.GroupLayout(jPanel17);
jPanel17.setLayout(jPanel17Layout);
jPanel17Layout.setHorizontalGroup(
jPanel17Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel17Layout.createSequentialGroup()
.addContainerGap()
.addComponent(jScrollPane13, javax.swing.GroupLayout.DEFAULT_SIZE, 259, Short.MAX_VALUE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jPanel17Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
.addComponent(jScrollPane14, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE)
.addComponent(jLabel20)
.addGroup(jPanel17Layout.createSequentialGroup()
.addComponent(btnRefreshOptifine)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(btnDownloadOptifine)))
.addContainerGap())
);
jPanel17Layout.setVerticalGroup(
jPanel17Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel17Layout.createSequentialGroup()
.addContainerGap()
.addGroup(jPanel17Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel17Layout.createSequentialGroup()
.addGroup(jPanel17Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(btnRefreshOptifine)
.addComponent(btnDownloadOptifine))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jLabel20)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jScrollPane14, javax.swing.GroupLayout.DEFAULT_SIZE, 200, Short.MAX_VALUE))
.addComponent(jScrollPane13, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE))
.addContainerGap())
);
jTabbedPane4.addTab("OptiFine", jPanel17);
javax.swing.GroupLayout jPanel15Layout = new javax.swing.GroupLayout(jPanel15);
jPanel15.setLayout(jPanel15Layout);
jPanel15Layout.setHorizontalGroup(
jPanel15Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel15Layout.createSequentialGroup()
.addContainerGap()
.addComponent(jTabbedPane4)
.addContainerGap())
);
jPanel15Layout.setVerticalGroup(
jPanel15Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel15Layout.createSequentialGroup()
.addContainerGap()
.addComponent(jTabbedPane4)
.addContainerGap())
);
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
this.setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGap(0, 430, Short.MAX_VALUE)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jPanel15, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGap(0, 319, Short.MAX_VALUE)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jPanel15, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
}// </editor-fold>//GEN-END:initComponents
private void btnRefreshForgeActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnRefreshForgeActionPerformed
refreshForgeVersions();
}//GEN-LAST:event_btnRefreshForgeActionPerformed
private void btnDownloadForgeActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnDownloadForgeActionPerformed
int idx = lstForge.getSelectedRow();
if (idx == -1) {
return;
}
ForgeVersion v = forgeVersions.get(idx);
String url;
final String filepath = Utils.addSeparator(Utils.currentDir()) + "forge-installer.jar";
if (v.installer[1] != null) {
String info = "Downloading forge installer...(0/2)";
txtForge.setText(info);
txtForge.updateUI();
DownloadWindow dw = new DownloadWindow();
url = v.installer[1];
dw.addDownloadURL("forge", url, filepath);
dw.setVisible(true);
if (!dw.isDownloadSuccessfully()) {
String info4 = txtForge.getText();
info4 += "\nFailed to download forge!!!";
txtForge.setText(info4);
txtForge.updateUI();
} else {
String info2 = txtForge.getText();
info2 += "\n" + "Installing forge...(1/2)";
txtForge.setText(info2);
String msg = C.I18N.getString("ForgeInstall");
MessageBox.Show(msg);
Clipboard cb = Toolkit.getDefaultToolkit().getSystemClipboard();
Transferable t = new StringSelection(getGameDir());
cb.setContents(t, null);
String[] cmd = new String[]{
Utils.getJavaDir(), "-jar", filepath
};
BaseLauncherProfile.tryWriteProfile(getGameDir());
try {
Process pro = Runtime.getRuntime().exec(cmd);
JavaProcess jp = new JavaProcess(Arrays.asList(cmd), pro);
ProcessThread thread = new ProcessThread(jp, new ProcessThread.ProcessListener() {
@Override
public void onStop() {
String info3 = txtForge.getText();
new File(filepath).delete();
info3 += "\n" + "Installed forge.(2/2)";
txtForge.setText(info3);
txtForge.updateUI();
}
@Override
public void onPrintln(String line) {
LogWindow.instance.log(line);
}
});
thread.start();
} catch (IOException ex) {
Logger.getLogger(InstallersPanel.class.getName()).log(Level.SEVERE, null, ex);
}
}
} else {
DownloadWindow dw = new DownloadWindow();
url = v.universal[1];
dw.addDownloadURL("forge", url, filepath);
dw.setVisible(true);
if (!dw.isDownloadSuccessfully()) {
String info4 = txtForge.getText();
info4 += "\nFailed to download forge!!!";
txtForge.setText(info4);
txtForge.updateUI();
} else {
String info2 = txtForge.getText();
info2 += "\n" + "Installing forge...(1/2)";
txtForge.setText(info2);
txtForge.updateUI();
String minecraftjar = getGameDir();
if (HMCLPlugin.env.getVersion().isVer16) {
minecraftjar += "versions" + File.separator + HMCLPlugin.env.getVersion().name + File.separator + HMCLPlugin.env.getVersion().name + ".jar";
} else {
minecraftjar += "bin" + File.separator + "minecraft.jar";
}
ForgeOldInstaller.install(minecraftjar, minecraftjar, filepath);
String info3 = txtForge.getText();
new File(filepath).delete();
info3 += "\n" + "Installed forge.(2/2)";
txtForge.setText(info3);
txtForge.updateUI();
}
}
}//GEN-LAST:event_btnDownloadForgeActionPerformed
private void btnForgeChangeLogActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnForgeChangeLogActionPerformed
final String changeLogUrl = forgeVersions.get(lstForge.getSelectedRow()).changelog;
txtForge.setText(java.util.ResourceBundle.getBundle("org/jackhuang/hellominecraftlauncher/I18N").getString("获取中"));
Thread t = new Thread() {
@Override
public void run() {
txtForge.setText(URLGet.get(changeLogUrl));
}
};
t.start();
}//GEN-LAST:event_btnForgeChangeLogActionPerformed
private void btnRefreshOptifineActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnRefreshOptifineActionPerformed
refreshOptifineVersions();
}//GEN-LAST:event_btnRefreshOptifineActionPerformed
private void btnDownloadOptifineActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnDownloadOptifineActionPerformed
int idx = lstOptifine.getSelectedRow();
if (idx == -1) {
return;
}
OptifineVersion v = optifineVersions.get(idx);
String info = "Downloading optifine...(0/2)";
final String filepath = Utils.addSeparator(Utils.currentDir()) + "optifine.jar";
txtOptifine.setText(info);
txtOptifine.updateUI();
OptifineFormatDownloadThread thread;
thread = new OptifineFormatDownloadThread(new DoneListener<String, Object>() {
@Override
public void onDone(String url, Object value2) {
String info2 = txtOptifine.getText();
info2 += "\nurl: " + url;
info2 += "\nInstalling optifine...(1/2)";
txtOptifine.setText(info2);
txtOptifine.updateUI();
DownloadWindow dw = new DownloadWindow();
dw.addDownloadURL("optifine", url, filepath);
dw.setVisible(true);
if (dw.isDownloadSuccessfully()) {
String minecraftjar = getGameDir();
if (HMCLPlugin.env.getVersion().isVer16) {
minecraftjar += "versions" + File.separator + HMCLPlugin.env.getVersion().name + File.separator + HMCLPlugin.env.getVersion().name + ".jar";
} else {
minecraftjar += "bin" + File.separator + "minecraft.jar";
}
ForgeOldInstaller.install(minecraftjar, minecraftjar, filepath);
String info3 = txtOptifine.getText();
new File(filepath).delete();
info3 += "\n" + "Installed optifine.(2/2)";
txtOptifine.setText(info3);
txtOptifine.updateUI();
} else {
String info4 = txtOptifine.getText();
info4 += "\nFailed to download optifine!!!";
txtOptifine.setText(info4);
txtOptifine.updateUI();
}
}
}, v, HMCLPlugin.env.getSourceType());
thread.start();
}//GEN-LAST:event_btnDownloadOptifineActionPerformed
public void useOptifineVersions() {
if (showOptifineVersions == null) {
return;
}
DefaultTableModel model = (DefaultTableModel) lstOptifine.getModel();
while (model.getRowCount() > 0) {
model.removeRow(0);
}
for (OptifineVersion v : showOptifineVersions) {
Object[] row = new Object[]{
v.type, v.ver, v.mcver, v.date
};
model.addRow(row);
}
lstOptifine.updateUI();
}
public void refreshForgeVersions() {
ForgeFormatThread thread = new ForgeFormatThread(
new DoneListener<List<ForgeVersion>, Object>() {
@Override
public void onDone(List<ForgeVersion> value, Object value2) {
forgeVersions = value;
reloadForgeList();
}
}, HMCLPlugin.env.getSourceType());
thread.start();
}
int getCharShowTime(String s, char c) {
int res = 0;
for (int i = 0; i < s.length(); i++) {
if (s.charAt(i) == c) {
res++;
}
}
return res;
}
String formatVersion(String ver) {
int i = (getCharShowTime(ver, '.'));
if (i == 0) {
if (getCharShowTime(ver, 'w') > 0) {
return ver;
} else {
return ver + ".0.0";
}
} else if (i == 1) {
return ver + ".0";
} else {
return ver;
}
}
public void reloadOptifineList() {
if (optifineVersions == null) {
return;
}
String mcver = HMCLPlugin.env.getMinecraftVersion().version;
if (mcver == null) {
showOptifineVersions = optifineVersions;
useOptifineVersions();
return;
}
mcver = formatVersion(mcver);
ArrayList<OptifineVersion> al = new ArrayList<OptifineVersion>();
for (OptifineVersion v : optifineVersions) {
if(v.mcver == null) continue;
if (formatVersion(v.mcver).equals(mcver)) {
al.add(v);
}
}
if (al.size() > 0) {
showOptifineVersions = al;
}
useOptifineVersions();
}
public void useForgeVersions() {
if (showForgeVersions == null) {
return;
}
DefaultTableModel model = (DefaultTableModel) lstForge.getModel();
while (model.getRowCount() > 0) {
model.removeRow(0);
}
for (ForgeVersion v : showForgeVersions) {
Object[] row = new Object[]{
"forge", v.ver, v.mcver, v.releasetime
};
model.addRow(row);
}
lstForge.updateUI();
}
public void reloadForgeList() {
if (forgeVersions == null) {
return;
}
String mcver = HMCLPlugin.env.getMinecraftVersion().version;
if (mcver == null) {
showForgeVersions = forgeVersions;
useForgeVersions();
return;
}
mcver = formatVersion(mcver);
ArrayList<ForgeVersion> al = new ArrayList<ForgeVersion>();
for (ForgeVersion v : forgeVersions) {
if(v.mcver == null) continue;
if (formatVersion(v.mcver).equals(mcver)) {
al.add(v);
}
}
if (al.size() > 0) {
showForgeVersions = al;
}
useForgeVersions();
}
void refreshOptifineVersions() {
OptifineFormatThread thread = new OptifineFormatThread(
new DoneListener<List<OptifineVersion>, Object>() {
@Override
public void onDone(List<OptifineVersion> value, Object value2) {
optifineVersions = value;
reloadOptifineList();
}
}, HMCLPlugin.env.getSourceType());
thread.start();
}
private String getGameDir() {
return Utils.getGameDir(HMCLPlugin.env.getVersion(), HMCLPlugin.env.getDefaultGameDir());
}
List<ForgeVersion> forgeVersions, showForgeVersions;
List<OptifineVersion> optifineVersions, showOptifineVersions;
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JButton btnDownloadForge;
private javax.swing.JButton btnDownloadOptifine;
private javax.swing.JButton btnForgeChangeLog;
private javax.swing.JButton btnRefreshForge;
private javax.swing.JButton btnRefreshOptifine;
private javax.swing.JLabel jLabel12;
private javax.swing.JLabel jLabel20;
private javax.swing.JPanel jPanel15;
private javax.swing.JPanel jPanel16;
private javax.swing.JPanel jPanel17;
private javax.swing.JScrollPane jScrollPane11;
private javax.swing.JScrollPane jScrollPane12;
private javax.swing.JScrollPane jScrollPane13;
private javax.swing.JScrollPane jScrollPane14;
private javax.swing.JTabbedPane jTabbedPane4;
private javax.swing.JTable lstForge;
private javax.swing.JTable lstOptifine;
private javax.swing.JTextArea txtForge;
private javax.swing.JTextArea txtOptifine;
// End of variables declaration//GEN-END:variables
}
@@ -0,0 +1,114 @@
<?xml version="1.0" encoding="UTF-8" ?>
<Form version="1.3" maxVersion="1.8" type="org.netbeans.modules.form.forminfo.JPanelFormInfo">
<Properties>
<Property name="name" type="java.lang.String" value="" noResource="true"/>
</Properties>
<AuxValues>
<AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="0"/>
<AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/>
<AuxValue name="FormSettings_generateFQN" type="java.lang.Boolean" value="true"/>
<AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="false"/>
<AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="false"/>
<AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="1"/>
<AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/>
<AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/>
<AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/>
</AuxValues>
<Layout>
<DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0">
<EmptySpace min="0" pref="406" max="32767" attributes="0"/>
<Group type="103" rootIndex="1" groupAlignment="0" attributes="0">
<Component id="jPanel11" alignment="1" max="32767" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
<DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0">
<EmptySpace min="0" pref="302" max="32767" attributes="0"/>
<Group type="103" rootIndex="1" groupAlignment="0" attributes="0">
<Component id="jPanel11" alignment="1" max="32767" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
</Layout>
<SubComponents>
<Container class="javax.swing.JPanel" name="jPanel11">
<Layout>
<DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Component id="jScrollPane7" pref="311" max="32767" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" max="-2" attributes="0">
<Component id="btnBackupTo" alignment="0" max="32767" attributes="0"/>
<Component id="btnManageTexturePacks1" alignment="0" max="32767" attributes="0"/>
</Group>
<EmptySpace max="-2" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
<DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<Component id="btnManageTexturePacks1" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="btnBackupTo" min="-2" max="-2" attributes="0"/>
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
</Group>
<Component id="jScrollPane7" alignment="0" pref="282" max="32767" attributes="0"/>
</Group>
<EmptySpace max="-2" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
</Layout>
<SubComponents>
<Container class="javax.swing.JScrollPane" name="jScrollPane7">
<AuxValues>
<AuxValue name="autoScrollPane" type="java.lang.Boolean" value="true"/>
</AuxValues>
<Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/>
<SubComponents>
<Component class="javax.swing.JList" name="lstSavesBackup">
<Properties>
<Property name="model" type="javax.swing.ListModel" editor="org.netbeans.modules.form.editors2.ListModelEditor">
<StringArray count="0"/>
</Property>
</Properties>
</Component>
</SubComponents>
</Container>
<Component class="javax.swing.JButton" name="btnBackupTo">
<Properties>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="org/jackhuang/hellominecraftlauncher/I18N.properties" key="&#x5907;&#x4efd;&#x5230;" replaceFormat="java.util.ResourceBundle.getBundle(&quot;{bundleNameSlashes}&quot;).getString(&quot;{key}&quot;)"/>
</Property>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnBackupToActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JButton" name="btnManageTexturePacks1">
<Properties>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="org/jackhuang/hellominecraftlauncher/I18N.properties" key="&#x7ba1;&#x7406;" replaceFormat="java.util.ResourceBundle.getBundle(&quot;{bundleNameSlashes}&quot;).getString(&quot;{key}&quot;)"/>
</Property>
<Property name="toolTipText" type="java.lang.String" value="&#x6253;&#x5f00;&#x8d44;&#x6e90;&#x7ba1;&#x7406;&#x5668;"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnManageTexturePacks1ActionPerformed"/>
</Events>
</Component>
</SubComponents>
</Container>
</SubComponents>
</Form>
@@ -0,0 +1,186 @@
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package org.jackhuang.hellominecraftlauncher.plugin.editpanels;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import javax.swing.DefaultListModel;
import javax.swing.JFileChooser;
import javax.swing.filechooser.FileFilter;
import org.jackhuang.hellominecraftlauncher.apis.utils.Compressor;
import org.jackhuang.hellominecraftlauncher.apis.utils.MessageBox;
import org.jackhuang.hellominecraftlauncher.apis.utils.Utils;
import org.jackhuang.hellominecraftlauncher.plugin.HMCLPlugin;
import org.jackhuang.hellominecraftlauncher.utilities.C;
/**
*
* @author hyh
*/
public class SaveWorldPanel extends javax.swing.JPanel {
/**
* Creates new form SaveWorldPanel
*/
public SaveWorldPanel() {
initComponents();
setName(C.I18N.getString("WorldSaving"));
}
/**
* This method is called from within the constructor to initialize the form.
* WARNING: Do NOT modify this code. The content of this method is always
* regenerated by the Form Editor.
*/
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
jPanel11 = new javax.swing.JPanel();
jScrollPane7 = new javax.swing.JScrollPane();
lstSavesBackup = new javax.swing.JList();
btnBackupTo = new javax.swing.JButton();
btnManageTexturePacks1 = new javax.swing.JButton();
setName(""); // NOI18N
jScrollPane7.setViewportView(lstSavesBackup);
java.util.ResourceBundle bundle = java.util.ResourceBundle.getBundle("org/jackhuang/hellominecraftlauncher/I18N"); // NOI18N
btnBackupTo.setText(bundle.getString("备份到")); // NOI18N
btnBackupTo.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnBackupToActionPerformed(evt);
}
});
btnManageTexturePacks1.setText(bundle.getString("管理")); // NOI18N
btnManageTexturePacks1.setToolTipText("打开资源管理器");
btnManageTexturePacks1.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnManageTexturePacks1ActionPerformed(evt);
}
});
javax.swing.GroupLayout jPanel11Layout = new javax.swing.GroupLayout(jPanel11);
jPanel11.setLayout(jPanel11Layout);
jPanel11Layout.setHorizontalGroup(
jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel11Layout.createSequentialGroup()
.addContainerGap()
.addComponent(jScrollPane7, javax.swing.GroupLayout.DEFAULT_SIZE, 311, Short.MAX_VALUE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
.addComponent(btnBackupTo, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(btnManageTexturePacks1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addContainerGap())
);
jPanel11Layout.setVerticalGroup(
jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel11Layout.createSequentialGroup()
.addContainerGap()
.addGroup(jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel11Layout.createSequentialGroup()
.addComponent(btnManageTexturePacks1)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(btnBackupTo)
.addGap(0, 0, Short.MAX_VALUE))
.addComponent(jScrollPane7, javax.swing.GroupLayout.DEFAULT_SIZE, 282, Short.MAX_VALUE))
.addContainerGap())
);
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
this.setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGap(0, 406, Short.MAX_VALUE)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jPanel11, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGap(0, 302, Short.MAX_VALUE)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jPanel11, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
}// </editor-fold>//GEN-END:initComponents
private void btnBackupToActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnBackupToActionPerformed
String str = (String) lstSavesBackup.getSelectedValue();
if (str == null) {
return;
}
JFileChooser fc = new JFileChooser();
fc.setFileSelectionMode(JFileChooser.FILES_ONLY);
fc.setDialogTitle(C.I18N.getString("保存压缩包到"));
fc.setMultiSelectionEnabled(false);
fc.setFileFilter(new ZipFileFilter());
fc.setSelectedFile(new File(str + ".zip"));
fc.showSaveDialog(this);
try {
String path = fc.getSelectedFile().getCanonicalPath();
String path2 = getGameDir() + "saves" + File.separator + str;
Compressor.zip(path2, path);
} catch (IOException e) {
MessageBox.Show(C.I18N.getString("保存失败"));
e.printStackTrace();
}
}//GEN-LAST:event_btnBackupToActionPerformed
private void btnManageTexturePacks1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnManageTexturePacks1ActionPerformed
try {
File f = new File(getGameDir() + "saves");
f.mkdirs();
java.awt.Desktop.getDesktop().open(f);
} catch (Exception ex) {
MessageBox.Show(C.I18N.getString("无法打开资源管理器: ") + ex.getMessage());
}
}//GEN-LAST:event_btnManageTexturePacks1ActionPerformed
private String getGameDir() {
return Utils.getGameDir(HMCLPlugin.env.getVersion(), HMCLPlugin.env.getDefaultGameDir());
}
class ZipFileFilter extends FileFilter {
public String getDescription() {
return "*.zip(*.zip)";
}
public boolean accept(File file) {
String name = file.getName();
return name.toLowerCase().endsWith(".zip");
}
}
public void loadSaves() {
String path = getGameDir() + "saves";
File file = new File(path);
lstSavesBackupModel.clear();
lstSavesBackup.setModel(lstSavesBackupModel);
if (!file.exists()) {
return;
}
ArrayList<String> al = Utils.findAllDir(file);
for (String s : al) {
lstSavesBackupModel.addElement(s);
}
lstSavesBackup.updateUI();
}
DefaultListModel
lstSavesBackupModel = new DefaultListModel();
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JButton btnBackupTo;
private javax.swing.JButton btnManageTexturePacks1;
private javax.swing.JPanel jPanel11;
private javax.swing.JScrollPane jScrollPane7;
private javax.swing.JList lstSavesBackup;
// End of variables declaration//GEN-END:variables
}
@@ -0,0 +1,148 @@
<?xml version="1.0" encoding="UTF-8" ?>
<Form version="1.5" maxVersion="1.8" type="org.netbeans.modules.form.forminfo.JPanelFormInfo">
<Properties>
<Property name="name" type="java.lang.String" value="" noResource="true"/>
</Properties>
<AuxValues>
<AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="0"/>
<AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/>
<AuxValue name="FormSettings_generateFQN" type="java.lang.Boolean" value="true"/>
<AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="false"/>
<AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="false"/>
<AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="1"/>
<AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/>
<AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/>
<AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/>
</AuxValues>
<Layout>
<DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0">
<EmptySpace min="0" pref="406" max="32767" attributes="0"/>
<Group type="103" rootIndex="1" groupAlignment="0" attributes="0">
<Component id="jPanel13" alignment="0" max="32767" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
<DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0">
<EmptySpace min="0" pref="302" max="32767" attributes="0"/>
<Group type="103" rootIndex="1" groupAlignment="0" attributes="0">
<Component id="jPanel13" alignment="0" max="32767" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
</Layout>
<SubComponents>
<Container class="javax.swing.JPanel" name="jPanel13">
<Layout>
<DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<Component id="jScrollPane9" pref="333" max="32767" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Component id="btnRefreshServer" alignment="1" min="-2" max="-2" attributes="0"/>
<Component id="btnAddServer" alignment="1" min="-2" max="-2" attributes="0"/>
<Component id="btnDeleteServer" alignment="1" min="-2" max="-2" attributes="0"/>
<Component id="btnEditServer" alignment="1" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace max="-2" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
<DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0">
<Component id="jScrollPane9" alignment="0" pref="0" max="32767" attributes="0"/>
<Group type="102" alignment="0" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Component id="btnRefreshServer" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="btnAddServer" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="btnDeleteServer" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="btnEditServer" min="-2" max="-2" attributes="0"/>
<EmptySpace pref="182" max="32767" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
</Layout>
<SubComponents>
<Container class="javax.swing.JScrollPane" name="jScrollPane9">
<AuxValues>
<AuxValue name="autoScrollPane" type="java.lang.Boolean" value="true"/>
</AuxValues>
<Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/>
<SubComponents>
<Component class="javax.swing.JTable" name="lstServer">
<Properties>
<Property name="model" type="javax.swing.table.TableModel" editor="org.netbeans.modules.form.editors2.TableModelEditor">
<Table columnCount="7" rowCount="0">
<Column editable="false" title="&#x670d;&#x52a1;&#x5668;&#x540d;" type="java.lang.String"/>
<Column editable="false" title="&#x9690;&#x85cf;&#x5730;&#x5740;" type="java.lang.Boolean"/>
<Column editable="false" title="&#x5730;&#x5740;" type="java.lang.String"/>
<Column editable="false" title="&#x670d;&#x52a1;&#x5668;&#x4ecb;&#x7ecd;" type="java.lang.String"/>
<Column editable="false" title="&#x7248;&#x672c;" type="java.lang.String"/>
<Column editable="false" title="&#x5728;&#x7ebf;&#x4eba;&#x6570;" type="java.lang.Integer"/>
<Column editable="false" title="&#x5ef6;&#x8fdf;" type="java.lang.String"/>
</Table>
</Property>
<Property name="tableHeader" type="javax.swing.table.JTableHeader" editor="org.netbeans.modules.form.editors2.JTableHeaderEditor">
<TableHeader reorderingAllowed="true" resizingAllowed="true"/>
</Property>
</Properties>
</Component>
</SubComponents>
</Container>
<Component class="javax.swing.JButton" name="btnRefreshServer">
<Properties>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="org/jackhuang/hellominecraftlauncher/I18N.properties" key="&#x5237;&#x65b0;" replaceFormat="java.util.ResourceBundle.getBundle(&quot;{bundleNameSlashes}&quot;).getString(&quot;{key}&quot;)"/>
</Property>
<Property name="toolTipText" type="java.lang.String" value="&#x5237;&#x65b0;&#x5217;&#x8868;"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnRefreshServerActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JButton" name="btnAddServer">
<Properties>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="org/jackhuang/hellominecraftlauncher/I18N.properties" key="&#x6dfb;&#x52a0;" replaceFormat="java.util.ResourceBundle.getBundle(&quot;{bundleNameSlashes}&quot;).getString(&quot;{key}&quot;)"/>
</Property>
<Property name="toolTipText" type="java.lang.String" value="&#x6dfb;&#x52a0;&#x9009;&#x4e2d;&#x670d;&#x52a1;&#x5668;"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnAddServerActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JButton" name="btnDeleteServer">
<Properties>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="org/jackhuang/hellominecraftlauncher/I18N.properties" key="&#x5220;&#x9664;" replaceFormat="java.util.ResourceBundle.getBundle(&quot;{bundleNameSlashes}&quot;).getString(&quot;{key}&quot;)"/>
</Property>
<Property name="toolTipText" type="java.lang.String" value="&#x5220;&#x9664;&#x9009;&#x4e2d;&#x670d;&#x52a1;&#x5668;"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnDeleteServerActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JButton" name="btnEditServer">
<Properties>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="org/jackhuang/hellominecraftlauncher/I18N.properties" key="&#x7f16;&#x8f91;" replaceFormat="java.util.ResourceBundle.getBundle(&quot;{bundleNameSlashes}&quot;).getString(&quot;{key}&quot;)"/>
</Property>
<Property name="toolTipText" type="java.lang.String" value="&#x7f16;&#x8f91;&#x9009;&#x4e2d;&#x670d;&#x52a1;&#x5668;"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnEditServerActionPerformed"/>
</Events>
</Component>
</SubComponents>
</Container>
</SubComponents>
</Form>
@@ -0,0 +1,381 @@
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package org.jackhuang.hellominecraftlauncher.plugin.editpanels;
import java.io.File;
import java.io.InputStream;
import java.io.OutputStream;
import java.net.Socket;
import java.util.Calendar;
import java.util.TimeZone;
import javax.swing.table.DefaultTableModel;
import org.jackhuang.hellominecraftlauncher.apis.DoneListener;
import org.jackhuang.hellominecraftlauncher.apis.utils.Utils;
import org.jackhuang.hellominecraftlauncher.loaders.serverlist.ServerInfo;
import org.jackhuang.hellominecraftlauncher.loaders.serverlist.ServerList;
import org.jackhuang.hellominecraftlauncher.plugin.HMCLPlugin;
import org.jackhuang.hellominecraftlauncher.utilities.C;
/**
*
* @author hyh
*/
public class ServerEditPanel extends javax.swing.JPanel {
/**
* Creates new form ServerEditPanel
*/
public ServerEditPanel() {
initComponents();
setName(C.I18N.getString("ServerEditor"));
String[] titlesA = new String[]{C.I18N.getString("ServerName"), C.I18N.getString("HideAddress"), C.I18N.getString("Address"), C.I18N.getString("Introduction"), C.I18N.getString("Version"), C.I18N.getString("Online"), C.I18N.getString("Delay")};
Class[] typesA = new Class[]{String.class, Boolean.class, String.class, String.class, String.class, String.class, String.class};
boolean[] canEditA = new boolean[]{false,false,false,false,false,false,false};
lstServer.setModel(Utils.makeDefaultTableModel(titlesA, typesA, canEditA));
}
/**
* This method is called from within the constructor to initialize the form.
* WARNING: Do NOT modify this code. The content of this method is always
* regenerated by the Form Editor.
*/
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
jPanel13 = new javax.swing.JPanel();
jScrollPane9 = new javax.swing.JScrollPane();
lstServer = new javax.swing.JTable();
btnRefreshServer = new javax.swing.JButton();
btnAddServer = new javax.swing.JButton();
btnDeleteServer = new javax.swing.JButton();
btnEditServer = new javax.swing.JButton();
setName(""); // NOI18N
lstServer.setModel(new javax.swing.table.DefaultTableModel(
new Object [][] {
},
new String [] {
"服务器名", "隐藏地址", "地址", "服务器介绍", "版本", "在线人数", "延迟"
}
) {
Class[] types = new Class [] {
java.lang.String.class, java.lang.Boolean.class, java.lang.String.class, java.lang.String.class, java.lang.String.class, java.lang.Integer.class, java.lang.String.class
};
boolean[] canEdit = new boolean [] {
false, false, false, false, false, false, false
};
public Class getColumnClass(int columnIndex) {
return types [columnIndex];
}
public boolean isCellEditable(int rowIndex, int columnIndex) {
return canEdit [columnIndex];
}
});
jScrollPane9.setViewportView(lstServer);
java.util.ResourceBundle bundle = java.util.ResourceBundle.getBundle("org/jackhuang/hellominecraftlauncher/I18N"); // NOI18N
btnRefreshServer.setText(bundle.getString("刷新")); // NOI18N
btnRefreshServer.setToolTipText("刷新列表");
btnRefreshServer.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnRefreshServerActionPerformed(evt);
}
});
btnAddServer.setText(bundle.getString("添加")); // NOI18N
btnAddServer.setToolTipText("添加选中服务器");
btnAddServer.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnAddServerActionPerformed(evt);
}
});
btnDeleteServer.setText(bundle.getString("删除")); // NOI18N
btnDeleteServer.setToolTipText("删除选中服务器");
btnDeleteServer.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnDeleteServerActionPerformed(evt);
}
});
btnEditServer.setText(bundle.getString("编辑")); // NOI18N
btnEditServer.setToolTipText("编辑选中服务器");
btnEditServer.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnEditServerActionPerformed(evt);
}
});
javax.swing.GroupLayout jPanel13Layout = new javax.swing.GroupLayout(jPanel13);
jPanel13.setLayout(jPanel13Layout);
jPanel13Layout.setHorizontalGroup(
jPanel13Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel13Layout.createSequentialGroup()
.addComponent(jScrollPane9, javax.swing.GroupLayout.DEFAULT_SIZE, 333, Short.MAX_VALUE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jPanel13Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(btnRefreshServer, javax.swing.GroupLayout.Alignment.TRAILING)
.addComponent(btnAddServer, javax.swing.GroupLayout.Alignment.TRAILING)
.addComponent(btnDeleteServer, javax.swing.GroupLayout.Alignment.TRAILING)
.addComponent(btnEditServer, javax.swing.GroupLayout.Alignment.TRAILING))
.addContainerGap())
);
jPanel13Layout.setVerticalGroup(
jPanel13Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jScrollPane9, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE)
.addGroup(jPanel13Layout.createSequentialGroup()
.addContainerGap()
.addComponent(btnRefreshServer)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(btnAddServer)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(btnDeleteServer)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(btnEditServer)
.addContainerGap(182, Short.MAX_VALUE))
);
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
this.setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGap(0, 406, Short.MAX_VALUE)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jPanel13, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGap(0, 302, Short.MAX_VALUE)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jPanel13, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
}// </editor-fold>//GEN-END:initComponents
private void btnRefreshServerActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnRefreshServerActionPerformed
loadServers();
}//GEN-LAST:event_btnRefreshServerActionPerformed
private void btnAddServerActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnAddServerActionPerformed
ServerInfo info = new ServerInfo();
DoneListener<ServerInfo, Object> l = new DoneListener<ServerInfo, Object>() {
@Override
public void onDone(ServerInfo info, Object value2) {
sl.list.add(info);
sl.write();
Object[] row = makeRow(info);
DefaultTableModel model = (DefaultTableModel) lstServer.getModel();
model.addRow(row);
new LoadServerThread(info, listener, row, model.getRowCount() - 1).start();
}
};
ServerEditorWindow window = new ServerEditorWindow(null, true, info, l);
window.setVisible(true);
}//GEN-LAST:event_btnAddServerActionPerformed
private void btnDeleteServerActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnDeleteServerActionPerformed
int idx = lstServer.getSelectedRow();
if (idx == -1) {
return;
}
sl.list.remove(idx);
sl.write();
DefaultTableModel model = (DefaultTableModel) lstServer.getModel();
model.removeRow(idx);
lstServer.updateUI();
}//GEN-LAST:event_btnDeleteServerActionPerformed
private void btnEditServerActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnEditServerActionPerformed
final int selection = lstServer.getSelectedRow();
ServerInfo info = sl.list.get(selection);
DoneListener<ServerInfo, Object> l = new DoneListener<ServerInfo, Object>() {
@Override
public void onDone(ServerInfo info, Object value2) {
sl.list.add(info);
sl.write();
final DefaultTableModel model = (DefaultTableModel) lstServer.getModel();
Object[] row = new Object[7];
for (int i = 0; i < 7; i++) {
row[i] = model.getValueAt(selection, i);
}
new LoadServerThread(info, new DoneListener<Object[], Integer>() {
@Override
public void onDone(Object[] value, Integer rowLine) {
for (int i = 0; i < value.length; i++) {
model.setValueAt(value[i], rowLine, i);
}
lstServer.updateUI();
}
}, row, selection).start();
}
};
ServerEditorWindow window = new ServerEditorWindow(null, true, info, l);
window.setVisible(true);
}//GEN-LAST:event_btnEditServerActionPerformed
DefaultDoneListener listener = new DefaultDoneListener();
ServerList sl;
public void loadServers() {
DefaultTableModel model = (DefaultTableModel) lstServer.getModel();
while (model.getRowCount() > 0) {
model.removeRow(0);
}
String gameDir = Utils.getGameDir(HMCLPlugin.env.getVersion(), HMCLPlugin.env.getDefaultGameDir());
File file = new File(gameDir + "servers.dat");
if (file.exists()) {
sl = new ServerList(file);
for (ServerInfo info : sl.list) {
Object[] row = makeRow(info);
model.addRow(row);
new LoadServerThread(info, listener, row, model.getRowCount() - 1).start();
}
} else {
ServerList.writeEmptyFile(file);
sl = new ServerList(file);
}
}
class LoadServerThread extends Thread {
ServerInfo info;
DoneListener<Object[], Integer> listener;
Object[] row;
int rowNumber;
public LoadServerThread(ServerInfo info, DoneListener<Object[], Integer> listener,
Object[] row, int rowNumber) {
this.info = info;
this.listener = listener;
this.row = row;
this.rowNumber = rowNumber;
}
@Override
public void run() {
try {
TimeZone begin = Calendar.getInstance().getTimeZone();
String[] split = info.address.split(":");
Socket socket;
if (split.length >= 2) {
socket = new Socket(split[0], Utils.parseInt(split[1], 25565));
} else {
socket = new Socket(split[0], 25565);
}
socket.setSoTimeout(5000);
OutputStream os = socket.getOutputStream();
byte[] writes = new byte[1];
writes[0] = (byte) 254;
os.write(writes, 0, 1);
writes = new byte[1];
writes[0] = (byte) 1;
os.write(writes, 0, 1);
InputStream is = socket.getInputStream();
byte[] recive = new byte[512];
int bytes = is.read(recive);
if (recive[0] != -1) {
System.out.println(java.text.MessageFormat.format(C.I18N.getString("服务器{0}的回复无效"), new Object[]{info.name}));
return;
}
TimeZone end = Calendar.getInstance().getTimeZone();
String message = new String(recive, 4, bytes - 4);
StringBuilder remessage = new StringBuilder(30);
for (int i = 0; i < message.length(); i += 2) {
remessage.append(message.charAt(i));
}
message = remessage.toString();
os.close();
is.close();
socket.close();
char[] achar = message.toCharArray();
message = new String(achar);
if (message.charAt(0) == (char) 253
|| message.charAt(0) == (char) 65533) {
message = (char) 167 + message.substring(1);
}
String[] astring;
if (message.startsWith("\u00a7") && message.length() > 1) {
astring = message.substring(1).split("\0");
if (Utils.parseInt(astring[0], 0) == 1) {
row[3] = astring[3];
row[4] = astring[2];
int online = Utils.parseInt(astring[4], 0);
int maxplayer = Utils.parseInt(astring[5], 0);
row[5] = online + "/" + maxplayer;
}
} else {
row[3] = "";
row[4] = "";
row[5] = "";
}
int offset = (end.getRawOffset() - begin.getRawOffset());
row[6] = offset + "ms";
if (offset < 200) {
row[6] += C.I18N.getString(" 好 GREEN");
} else if (offset < 500) {
row[6] += C.I18N.getString(" 较好 BLUE");
} else if (offset < 1000) {
row[6] += C.I18N.getString(" 中 YELLOGREEN");
} else if (offset < 3000) {
row[6] += C.I18N.getString(" 较差 ORANGE");
} else {
row[6] += C.I18N.getString(" 差 ORANGERED");
}
} catch (Exception ex) {
System.err.println(ex.getMessage());
//Logger.getLogger(I18N.class.getName()).log(Level.SEVERE, null, ex);
row[6] = C.I18N.getString("无法连接");
}
listener.onDone(row, rowNumber);
}
}
public class DefaultDoneListener implements DoneListener<Object[], Integer> {
@Override
public void onDone(Object[] row, Integer rowLine) {
synchronized (ServerEditPanel.this) {
DefaultTableModel model = (DefaultTableModel) lstServer.getModel();
for (int i = 0; i < row.length; i++) {
model.setValueAt(row[i], rowLine, i);
}
}
}
}
Object[] makeRow(ServerInfo info) {
Object[] row = new Object[7];
row[0] = info.name;
row[1] = info.isHide;
if (info.isHide) {
row[2] = "";
} else {
row[2] = info.address;
}
row[6] = C.I18N.getString("连接中");
return row;
}
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JButton btnAddServer;
private javax.swing.JButton btnDeleteServer;
private javax.swing.JButton btnEditServer;
private javax.swing.JButton btnRefreshServer;
private javax.swing.JPanel jPanel13;
private javax.swing.JScrollPane jScrollPane9;
private javax.swing.JTable lstServer;
// End of variables declaration//GEN-END:variables
}
@@ -0,0 +1,123 @@
<?xml version="1.0" encoding="UTF-8" ?>
<Form version="1.3" maxVersion="1.8" type="org.netbeans.modules.form.forminfo.JDialogFormInfo">
<Properties>
<Property name="defaultCloseOperation" type="int" value="2"/>
</Properties>
<SyntheticProperties>
<SyntheticProperty name="formSizePolicy" type="int" value="1"/>
<SyntheticProperty name="generateCenter" type="boolean" value="false"/>
</SyntheticProperties>
<AuxValues>
<AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="0"/>
<AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/>
<AuxValue name="FormSettings_generateFQN" type="java.lang.Boolean" value="true"/>
<AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="false"/>
<AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="false"/>
<AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="1"/>
<AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/>
<AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/>
<AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/>
</AuxValues>
<Layout>
<DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" attributes="0">
<Group type="103" groupAlignment="0" attributes="0">
<Component id="jLabel1" alignment="0" min="-2" max="-2" attributes="0"/>
<Component id="jLabel2" alignment="0" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Component id="txtServerName" max="32767" attributes="0"/>
<Component id="txtAddress" max="32767" attributes="0"/>
</Group>
</Group>
<Group type="102" attributes="0">
<Component id="chkIsHide" min="-2" max="-2" attributes="0"/>
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
</Group>
<Group type="102" alignment="1" attributes="0">
<EmptySpace min="0" pref="62" max="32767" attributes="0"/>
<Component id="btnOK" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="btnCancel" min="-2" max="-2" attributes="0"/>
</Group>
</Group>
<EmptySpace max="-2" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
<DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="jLabel1" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="txtServerName" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="jLabel2" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="txtAddress" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Component id="chkIsHide" min="-2" max="-2" attributes="0"/>
<EmptySpace max="32767" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="btnOK" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="btnCancel" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace max="-2" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
</Layout>
<SubComponents>
<Component class="javax.swing.JLabel" name="jLabel1">
<Properties>
<Property name="text" type="java.lang.String" value="&#x670d;&#x52a1;&#x5668;&#x540d;"/>
</Properties>
</Component>
<Component class="javax.swing.JTextField" name="txtServerName">
<Events>
<EventHandler event="propertyChange" listener="java.beans.PropertyChangeListener" parameters="java.beans.PropertyChangeEvent" handler="txtServerNamePropertyChange"/>
</Events>
</Component>
<Component class="javax.swing.JLabel" name="jLabel2">
<Properties>
<Property name="text" type="java.lang.String" value="&#x5730;&#x5740;"/>
</Properties>
</Component>
<Component class="javax.swing.JTextField" name="txtAddress">
<Events>
<EventHandler event="propertyChange" listener="java.beans.PropertyChangeListener" parameters="java.beans.PropertyChangeEvent" handler="txtAddressPropertyChange"/>
</Events>
</Component>
<Component class="javax.swing.JCheckBox" name="chkIsHide">
<Properties>
<Property name="text" type="java.lang.String" value="&#x9690;&#x85cf;&#x5730;&#x5740;"/>
</Properties>
<Events>
<EventHandler event="propertyChange" listener="java.beans.PropertyChangeListener" parameters="java.beans.PropertyChangeEvent" handler="chkIsHidePropertyChange"/>
</Events>
</Component>
<Component class="javax.swing.JButton" name="btnOK">
<Properties>
<Property name="text" type="java.lang.String" value="&#x786e;&#x5b9a;"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnOKActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JButton" name="btnCancel">
<Properties>
<Property name="text" type="java.lang.String" value="&#x53d6;&#x6d88;"/>
</Properties>
</Component>
</SubComponents>
</Form>
@@ -0,0 +1,169 @@
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package org.jackhuang.hellominecraftlauncher.plugin.editpanels;
import java.awt.Dimension;
import java.awt.Toolkit;
import org.jackhuang.hellominecraftlauncher.apis.DoneListener;
import org.jackhuang.hellominecraftlauncher.loaders.serverlist.ServerInfo;
/**
*
* @author hyh
*/
public class ServerEditorWindow extends javax.swing.JDialog {
public ServerInfo info;
public DoneListener<ServerInfo, Object> listener;
/**
* Creates new form ServerEditorWindow
*/
public ServerEditorWindow(java.awt.Frame parent, boolean modal,
ServerInfo info, DoneListener<ServerInfo, Object> listener) {
super(parent, modal);
initComponents();
this.info = info;
this.listener = listener;
txtServerName.setText(info.name);
txtAddress.setText(info.address);
chkIsHide.setSelected(info.isHide);
Dimension scrSize = Toolkit.getDefaultToolkit().getScreenSize();
setLocation((scrSize.width - this.getWidth()) / 2,
(scrSize.height - this.getHeight()) / 2);
}
/**
* This method is called from within the constructor to initialize the form.
* WARNING: Do NOT modify this code. The content of this method is always
* regenerated by the Form Editor.
*/
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
jLabel1 = new javax.swing.JLabel();
txtServerName = new javax.swing.JTextField();
jLabel2 = new javax.swing.JLabel();
txtAddress = new javax.swing.JTextField();
chkIsHide = new javax.swing.JCheckBox();
btnOK = new javax.swing.JButton();
btnCancel = new javax.swing.JButton();
setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
jLabel1.setText("服务器名");
txtServerName.addPropertyChangeListener(new java.beans.PropertyChangeListener() {
public void propertyChange(java.beans.PropertyChangeEvent evt) {
txtServerNamePropertyChange(evt);
}
});
jLabel2.setText("地址");
txtAddress.addPropertyChangeListener(new java.beans.PropertyChangeListener() {
public void propertyChange(java.beans.PropertyChangeEvent evt) {
txtAddressPropertyChange(evt);
}
});
chkIsHide.setText("隐藏地址");
chkIsHide.addPropertyChangeListener(new java.beans.PropertyChangeListener() {
public void propertyChange(java.beans.PropertyChangeEvent evt) {
chkIsHidePropertyChange(evt);
}
});
btnOK.setText("确定");
btnOK.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnOKActionPerformed(evt);
}
});
btnCancel.setText("取消");
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel1)
.addComponent(jLabel2))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(txtServerName)
.addComponent(txtAddress)))
.addGroup(layout.createSequentialGroup()
.addComponent(chkIsHide)
.addGap(0, 0, Short.MAX_VALUE))
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
.addGap(0, 62, Short.MAX_VALUE)
.addComponent(btnOK)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(btnCancel)))
.addContainerGap())
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel1)
.addComponent(txtServerName, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel2)
.addComponent(txtAddress, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(chkIsHide)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(btnOK)
.addComponent(btnCancel))
.addContainerGap())
);
pack();
}// </editor-fold>//GEN-END:initComponents
private void btnOKActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnOKActionPerformed
if(info != null)
{
info.name = txtServerName.getText();
info.address = txtAddress.getText();
info.isHide = chkIsHide.isSelected();
}
listener.onDone(info, null);
this.dispose();
}//GEN-LAST:event_btnOKActionPerformed
private void txtServerNamePropertyChange(java.beans.PropertyChangeEvent evt) {//GEN-FIRST:event_txtServerNamePropertyChange
}//GEN-LAST:event_txtServerNamePropertyChange
private void txtAddressPropertyChange(java.beans.PropertyChangeEvent evt) {//GEN-FIRST:event_txtAddressPropertyChange
}//GEN-LAST:event_txtAddressPropertyChange
private void chkIsHidePropertyChange(java.beans.PropertyChangeEvent evt) {//GEN-FIRST:event_chkIsHidePropertyChange
}//GEN-LAST:event_chkIsHidePropertyChange
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JButton btnCancel;
private javax.swing.JButton btnOK;
private javax.swing.JCheckBox chkIsHide;
private javax.swing.JLabel jLabel1;
private javax.swing.JLabel jLabel2;
private javax.swing.JTextField txtAddress;
private javax.swing.JTextField txtServerName;
// End of variables declaration//GEN-END:variables
}
@@ -0,0 +1,268 @@
<?xml version="1.0" encoding="UTF-8" ?>
<Form version="1.3" maxVersion="1.8" type="org.netbeans.modules.form.forminfo.JPanelFormInfo">
<Properties>
<Property name="name" type="java.lang.String" value="" noResource="true"/>
</Properties>
<AuxValues>
<AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="0"/>
<AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/>
<AuxValue name="FormSettings_generateFQN" type="java.lang.Boolean" value="true"/>
<AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="false"/>
<AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="false"/>
<AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="1"/>
<AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/>
<AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/>
<AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/>
</AuxValues>
<Layout>
<DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0">
<EmptySpace min="0" pref="406" max="32767" attributes="0"/>
<Group type="103" rootIndex="1" groupAlignment="0" attributes="0">
<Component id="jPanel8" alignment="0" max="32767" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
<DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0">
<EmptySpace min="0" pref="319" max="32767" attributes="0"/>
<Group type="103" rootIndex="1" groupAlignment="0" attributes="0">
<Component id="jPanel8" alignment="0" max="32767" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
</Layout>
<SubComponents>
<Container class="javax.swing.JPanel" name="jPanel8">
<Layout>
<DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Component id="jTabbedPane3" max="32767" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
<DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Component id="jTabbedPane3" max="32767" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
</Layout>
<SubComponents>
<Container class="javax.swing.JTabbedPane" name="jTabbedPane3">
<Layout class="org.netbeans.modules.form.compat2.layouts.support.JTabbedPaneSupportLayout"/>
<SubComponents>
<Container class="javax.swing.JPanel" name="jPanel9">
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.support.JTabbedPaneSupportLayout" value="org.netbeans.modules.form.compat2.layouts.support.JTabbedPaneSupportLayout$JTabbedPaneConstraintsDescription">
<JTabbedPaneConstraints tabName="1.6&#x53ca;&#x4ee5;&#x4e0a;">
<Property name="tabTitle" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="org/jackhuang/hellominecraftlauncher/I18N.properties" key="1.6AndAbove" replaceFormat="java.util.ResourceBundle.getBundle(&quot;{bundleNameSlashes}&quot;).getString(&quot;{key}&quot;)"/>
</Property>
</JTabbedPaneConstraints>
</Constraint>
</Constraints>
<Layout>
<DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Component id="jScrollPane5" pref="298" max="32767" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Group type="103" alignment="0" groupAlignment="0" attributes="0">
<Component id="btnAddResourcePack" alignment="1" min="-2" max="-2" attributes="0"/>
<Component id="btnDeleteResourcePack" alignment="1" min="-2" max="-2" attributes="0"/>
</Group>
<Component id="btnManageResourcePack" alignment="1" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace max="-2" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
<DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<Component id="btnManageResourcePack" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="btnAddResourcePack" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="btnDeleteResourcePack" min="-2" max="-2" attributes="0"/>
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
</Group>
<Component id="jScrollPane5" alignment="0" pref="250" max="32767" attributes="0"/>
</Group>
<EmptySpace max="-2" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
</Layout>
<SubComponents>
<Container class="javax.swing.JScrollPane" name="jScrollPane5">
<AuxValues>
<AuxValue name="autoScrollPane" type="java.lang.Boolean" value="true"/>
</AuxValues>
<Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/>
<SubComponents>
<Component class="javax.swing.JList" name="lstResourcePacks">
<Properties>
<Property name="model" type="javax.swing.ListModel" editor="org.netbeans.modules.form.editors2.ListModelEditor">
<StringArray count="0"/>
</Property>
</Properties>
</Component>
</SubComponents>
</Container>
<Component class="javax.swing.JButton" name="btnAddResourcePack">
<Properties>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="org/jackhuang/hellominecraftlauncher/I18N.properties" key="&#x589e;&#x52a0;" replaceFormat="java.util.ResourceBundle.getBundle(&quot;{bundleNameSlashes}&quot;).getString(&quot;{key}&quot;)"/>
</Property>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnAddResourcePackActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JButton" name="btnDeleteResourcePack">
<Properties>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="org/jackhuang/hellominecraftlauncher/I18N.properties" key="&#x5220;&#x9664;" replaceFormat="java.util.ResourceBundle.getBundle(&quot;{bundleNameSlashes}&quot;).getString(&quot;{key}&quot;)"/>
</Property>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnDeleteResourcePackActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JButton" name="btnManageResourcePack">
<Properties>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="org/jackhuang/hellominecraftlauncher/I18N.properties" key="&#x7ba1;&#x7406;" replaceFormat="java.util.ResourceBundle.getBundle(&quot;{bundleNameSlashes}&quot;).getString(&quot;{key}&quot;)"/>
</Property>
<Property name="toolTipText" type="java.lang.String" value="&#x6253;&#x5f00;&#x8d44;&#x6e90;&#x7ba1;&#x7406;&#x5668;"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnManageResourcePackActionPerformed"/>
</Events>
</Component>
</SubComponents>
</Container>
<Container class="javax.swing.JPanel" name="jPanel10">
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.support.JTabbedPaneSupportLayout" value="org.netbeans.modules.form.compat2.layouts.support.JTabbedPaneSupportLayout$JTabbedPaneConstraintsDescription">
<JTabbedPaneConstraints tabName="1.5&#x53ca;&#x4ee5;&#x4e0b;">
<Property name="tabTitle" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="org/jackhuang/hellominecraftlauncher/I18N.properties" key="1.5AndBelow" replaceFormat="java.util.ResourceBundle.getBundle(&quot;{bundleNameSlashes}&quot;).getString(&quot;{key}&quot;)"/>
</Property>
</JTabbedPaneConstraints>
</Constraint>
</Constraints>
<Layout>
<DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Component id="jScrollPane6" pref="298" max="32767" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Group type="103" alignment="0" groupAlignment="0" attributes="0">
<Component id="btnAddTexturePack" alignment="1" min="-2" max="-2" attributes="0"/>
<Component id="btnDeleteTexturePack" alignment="1" min="-2" max="-2" attributes="0"/>
</Group>
<Component id="btnManageTexturePacks" alignment="1" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace max="-2" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
<DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<Component id="btnManageTexturePacks" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="btnAddTexturePack" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="btnDeleteTexturePack" min="-2" max="-2" attributes="0"/>
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
</Group>
<Component id="jScrollPane6" alignment="0" pref="250" max="32767" attributes="0"/>
</Group>
<EmptySpace max="-2" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
</Layout>
<SubComponents>
<Component class="javax.swing.JButton" name="btnAddTexturePack">
<Properties>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="org/jackhuang/hellominecraftlauncher/I18N.properties" key="&#x589e;&#x52a0;" replaceFormat="java.util.ResourceBundle.getBundle(&quot;{bundleNameSlashes}&quot;).getString(&quot;{key}&quot;)"/>
</Property>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnAddTexturePackActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JButton" name="btnDeleteTexturePack">
<Properties>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="org/jackhuang/hellominecraftlauncher/I18N.properties" key="&#x5220;&#x9664;" replaceFormat="java.util.ResourceBundle.getBundle(&quot;{bundleNameSlashes}&quot;).getString(&quot;{key}&quot;)"/>
</Property>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnDeleteTexturePackActionPerformed"/>
</Events>
</Component>
<Container class="javax.swing.JScrollPane" name="jScrollPane6">
<AuxValues>
<AuxValue name="autoScrollPane" type="java.lang.Boolean" value="true"/>
</AuxValues>
<Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/>
<SubComponents>
<Component class="javax.swing.JList" name="lstTexturePacks">
<Properties>
<Property name="model" type="javax.swing.ListModel" editor="org.netbeans.modules.form.editors2.ListModelEditor">
<StringArray count="0"/>
</Property>
</Properties>
</Component>
</SubComponents>
</Container>
<Component class="javax.swing.JButton" name="btnManageTexturePacks">
<Properties>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="org/jackhuang/hellominecraftlauncher/I18N.properties" key="&#x7ba1;&#x7406;" replaceFormat="java.util.ResourceBundle.getBundle(&quot;{bundleNameSlashes}&quot;).getString(&quot;{key}&quot;)"/>
</Property>
<Property name="toolTipText" type="java.lang.String" value="&#x6253;&#x5f00;&#x8d44;&#x6e90;&#x7ba1;&#x7406;&#x5668;"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnManageTexturePacksActionPerformed"/>
</Events>
</Component>
</SubComponents>
</Container>
</SubComponents>
</Container>
</SubComponents>
</Container>
</SubComponents>
</Form>
@@ -0,0 +1,311 @@
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package org.jackhuang.hellominecraftlauncher.plugin.editpanels;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import javax.swing.DefaultListModel;
import javax.swing.JFileChooser;
import org.jackhuang.hellominecraftlauncher.apis.utils.MessageBox;
import org.jackhuang.hellominecraftlauncher.apis.utils.Utils;
import org.jackhuang.hellominecraftlauncher.plugin.HMCLPlugin;
import org.jackhuang.hellominecraftlauncher.utilities.C;
import org.jackhuang.hellominecraftlauncher.utilities.FolderOpener;
/**
*
* @author hyh
*/
public class TexturepackEditPanel extends javax.swing.JPanel {
/**
* Creates new form TexturepackEditPanel
*/
public TexturepackEditPanel() {
initComponents();
setName(C.I18N.getString("TexturepackEditor"));
}
/**
* This method is called from within the constructor to initialize the form.
* WARNING: Do NOT modify this code. The content of this method is always
* regenerated by the Form Editor.
*/
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
jPanel8 = new javax.swing.JPanel();
jTabbedPane3 = new javax.swing.JTabbedPane();
jPanel9 = new javax.swing.JPanel();
jScrollPane5 = new javax.swing.JScrollPane();
lstResourcePacks = new javax.swing.JList();
btnAddResourcePack = new javax.swing.JButton();
btnDeleteResourcePack = new javax.swing.JButton();
btnManageResourcePack = new javax.swing.JButton();
jPanel10 = new javax.swing.JPanel();
btnAddTexturePack = new javax.swing.JButton();
btnDeleteTexturePack = new javax.swing.JButton();
jScrollPane6 = new javax.swing.JScrollPane();
lstTexturePacks = new javax.swing.JList();
btnManageTexturePacks = new javax.swing.JButton();
setName(""); // NOI18N
jScrollPane5.setViewportView(lstResourcePacks);
java.util.ResourceBundle bundle = java.util.ResourceBundle.getBundle("org/jackhuang/hellominecraftlauncher/I18N"); // NOI18N
btnAddResourcePack.setText(bundle.getString("增加")); // NOI18N
btnAddResourcePack.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnAddResourcePackActionPerformed(evt);
}
});
btnDeleteResourcePack.setText(bundle.getString("删除")); // NOI18N
btnDeleteResourcePack.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnDeleteResourcePackActionPerformed(evt);
}
});
btnManageResourcePack.setText(bundle.getString("管理")); // NOI18N
btnManageResourcePack.setToolTipText("打开资源管理器");
btnManageResourcePack.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnManageResourcePackActionPerformed(evt);
}
});
javax.swing.GroupLayout jPanel9Layout = new javax.swing.GroupLayout(jPanel9);
jPanel9.setLayout(jPanel9Layout);
jPanel9Layout.setHorizontalGroup(
jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel9Layout.createSequentialGroup()
.addContainerGap()
.addComponent(jScrollPane5, javax.swing.GroupLayout.DEFAULT_SIZE, 298, Short.MAX_VALUE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(btnAddResourcePack, javax.swing.GroupLayout.Alignment.TRAILING)
.addComponent(btnDeleteResourcePack, javax.swing.GroupLayout.Alignment.TRAILING))
.addComponent(btnManageResourcePack, javax.swing.GroupLayout.Alignment.TRAILING))
.addContainerGap())
);
jPanel9Layout.setVerticalGroup(
jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel9Layout.createSequentialGroup()
.addContainerGap()
.addGroup(jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel9Layout.createSequentialGroup()
.addComponent(btnManageResourcePack)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(btnAddResourcePack)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(btnDeleteResourcePack)
.addGap(0, 0, Short.MAX_VALUE))
.addComponent(jScrollPane5, javax.swing.GroupLayout.DEFAULT_SIZE, 250, Short.MAX_VALUE))
.addContainerGap())
);
jTabbedPane3.addTab(bundle.getString("1.6AndAbove"), jPanel9); // NOI18N
btnAddTexturePack.setText(bundle.getString("增加")); // NOI18N
btnAddTexturePack.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnAddTexturePackActionPerformed(evt);
}
});
btnDeleteTexturePack.setText(bundle.getString("删除")); // NOI18N
btnDeleteTexturePack.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnDeleteTexturePackActionPerformed(evt);
}
});
jScrollPane6.setViewportView(lstTexturePacks);
btnManageTexturePacks.setText(bundle.getString("管理")); // NOI18N
btnManageTexturePacks.setToolTipText("打开资源管理器");
btnManageTexturePacks.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnManageTexturePacksActionPerformed(evt);
}
});
javax.swing.GroupLayout jPanel10Layout = new javax.swing.GroupLayout(jPanel10);
jPanel10.setLayout(jPanel10Layout);
jPanel10Layout.setHorizontalGroup(
jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel10Layout.createSequentialGroup()
.addContainerGap()
.addComponent(jScrollPane6, javax.swing.GroupLayout.DEFAULT_SIZE, 298, Short.MAX_VALUE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(btnAddTexturePack, javax.swing.GroupLayout.Alignment.TRAILING)
.addComponent(btnDeleteTexturePack, javax.swing.GroupLayout.Alignment.TRAILING))
.addComponent(btnManageTexturePacks, javax.swing.GroupLayout.Alignment.TRAILING))
.addContainerGap())
);
jPanel10Layout.setVerticalGroup(
jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel10Layout.createSequentialGroup()
.addContainerGap()
.addGroup(jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel10Layout.createSequentialGroup()
.addComponent(btnManageTexturePacks)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(btnAddTexturePack)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(btnDeleteTexturePack)
.addGap(0, 0, Short.MAX_VALUE))
.addComponent(jScrollPane6, javax.swing.GroupLayout.DEFAULT_SIZE, 250, Short.MAX_VALUE))
.addContainerGap())
);
jTabbedPane3.addTab(bundle.getString("1.5AndBelow"), jPanel10); // NOI18N
javax.swing.GroupLayout jPanel8Layout = new javax.swing.GroupLayout(jPanel8);
jPanel8.setLayout(jPanel8Layout);
jPanel8Layout.setHorizontalGroup(
jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel8Layout.createSequentialGroup()
.addContainerGap()
.addComponent(jTabbedPane3)
.addContainerGap())
);
jPanel8Layout.setVerticalGroup(
jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel8Layout.createSequentialGroup()
.addContainerGap()
.addComponent(jTabbedPane3)
.addContainerGap())
);
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
this.setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGap(0, 406, Short.MAX_VALUE)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jPanel8, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGap(0, 319, Short.MAX_VALUE)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jPanel8, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
}// </editor-fold>//GEN-END:initComponents
private void btnAddResourcePackActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnAddResourcePackActionPerformed
JFileChooser fc = new JFileChooser();
fc.setFileSelectionMode(JFileChooser.FILES_ONLY);
fc.setDialogTitle(C.I18N.getString("选择资源包"));
fc.setMultiSelectionEnabled(false);
fc.showOpenDialog(this);
try {
String path = fc.getSelectedFile().getCanonicalPath();
lstResourcePacksModel.addElement(path);
} catch (IOException e) {
MessageBox.Show(C.I18N.getString("添加失败"));
e.printStackTrace();
}
}//GEN-LAST:event_btnAddResourcePackActionPerformed
private void btnDeleteResourcePackActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnDeleteResourcePackActionPerformed
String selectedName = (String) lstResourcePacks.getSelectedValue();
lstResourcePacksModel.removeElementAt(lstResourcePacks.getSelectedIndex());
String path = getGameDir();
path += "resourcepacks";
if (path == null) {
MessageBox.Show(C.I18N.getString("删除失败"));
return;
}
File newf = new File(path + File.separator + selectedName);
newf.delete();
}//GEN-LAST:event_btnDeleteResourcePackActionPerformed
private void btnManageResourcePackActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnManageResourcePackActionPerformed
FolderOpener.openResourcePacks(getGameDir());
}//GEN-LAST:event_btnManageResourcePackActionPerformed
private void btnAddTexturePackActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnAddTexturePackActionPerformed
JFileChooser fc = new JFileChooser();
fc.setFileSelectionMode(JFileChooser.FILES_ONLY);
fc.setDialogTitle(C.I18N.getString("选择材质包"));
fc.setMultiSelectionEnabled(false);
fc.showOpenDialog(this);
try {
String path = fc.getSelectedFile().getCanonicalPath();
lstTexturePacksModel.addElement(path);
} catch (IOException e) {
MessageBox.Show(C.I18N.getString("添加失败"));
e.printStackTrace();
}
}//GEN-LAST:event_btnAddTexturePackActionPerformed
private void btnDeleteTexturePackActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnDeleteTexturePackActionPerformed
String selectedName = (String) lstTexturePacks.getSelectedValue();
lstTexturePacksModel.removeElementAt(lstTexturePacks.getSelectedIndex());
String path = getGameDir();
path += "texturepacks";
if (path == null) {
MessageBox.Show(C.I18N.getString("删除失败"));
return;
}
File newf = new File(path + File.separator + selectedName);
newf.delete();
}//GEN-LAST:event_btnDeleteTexturePackActionPerformed
private void btnManageTexturePacksActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnManageTexturePacksActionPerformed
FolderOpener.openTextutrePacks(getGameDir());
}//GEN-LAST:event_btnManageTexturePacksActionPerformed
private String getGameDir() {
return Utils.getGameDir(HMCLPlugin.env.getVersion(), HMCLPlugin.env.getDefaultGameDir());
}
public void loadPacks() {
ArrayList<String> sl;
String path = getGameDir();
sl = Utils.findAllFile(new File(path + "resourcepacks"));
lstResourcePacksModel.clear();
for (String s : sl) {
lstResourcePacksModel.addElement(s);
}
lstResourcePacks.setModel(lstResourcePacksModel);
sl = Utils.findAllFile(new File(path + "texturepacks"));
for (String s : sl) {
lstTexturePacksModel.addElement(s);
}
lstTexturePacks.setModel(lstTexturePacksModel);
}
DefaultListModel lstResourcePacksModel = new DefaultListModel(),
lstTexturePacksModel = new DefaultListModel();
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JButton btnAddResourcePack;
private javax.swing.JButton btnAddTexturePack;
private javax.swing.JButton btnDeleteResourcePack;
private javax.swing.JButton btnDeleteTexturePack;
private javax.swing.JButton btnManageResourcePack;
private javax.swing.JButton btnManageTexturePacks;
private javax.swing.JPanel jPanel10;
private javax.swing.JPanel jPanel8;
private javax.swing.JPanel jPanel9;
private javax.swing.JScrollPane jScrollPane5;
private javax.swing.JScrollPane jScrollPane6;
private javax.swing.JTabbedPane jTabbedPane3;
private javax.swing.JList lstResourcePacks;
private javax.swing.JList lstTexturePacks;
// End of variables declaration//GEN-END:variables
}
@@ -0,0 +1,6 @@
MineLogin0=\u7f51\u7edc\u9519\u8bef
MineLogin1=\u7528\u6237\u540d\u6216\u5bc6\u7801\u4e0d\u5408\u6cd5
MineLogin2=\u5185\u90e8\u9519\u8bef
MineLogin3=\u7528\u6237\u4e0d\u5b58\u5728
MineLogin4=\u9700\u8981\u9a8c\u8bc1
MineLogin5=\u5bc6\u7801\u9519\u8bef
@@ -0,0 +1,6 @@
MineLogin0=Network error
MineLogin1=User name or password is not legitimate
MineLogin2=Internal error
MineLogin3=User does not exist
MineLogin4=Need to verify
MineLogin5=Wrong password
@@ -0,0 +1,6 @@
MineLogin0=\u7f51\u7edc\u9519\u8bef
MineLogin1=\u7528\u6237\u540d\u6216\u5bc6\u7801\u4e0d\u5408\u6cd5
MineLogin2=\u5185\u90e8\u9519\u8bef
MineLogin3=\u7528\u6237\u4e0d\u5b58\u5728
MineLogin4=\u9700\u8981\u9a8c\u8bc1
MineLogin5=\u5bc6\u7801\u9519\u8bef
@@ -0,0 +1,6 @@
MineLogin0=\u7db2\u7d61\u932f\u8aa4
MineLogin1=\u7528\u6236\u540d\u6216\u5bc6\u78bc\u4e0d\u5408\u6cd5
MineLogin2=\u5167\u90e8\u932f\u8aa4
MineLogin3=\u7528\u6236\u4e0d\u5b58\u5728
MineLogin4=\u9700\u8981\u9a57\u8b49
MineLogin5=\u5bc6\u78bc\u932f\u8aa4
@@ -0,0 +1,106 @@
package org.jackhuang.hellominecraftlauncher.plugin.logins;
import com.mojang.authlib.Agent;
import com.mojang.authlib.GameProfile;
import com.mojang.authlib.legacy.LegacyAuthenticationService;
import com.mojang.authlib.legacy.LegacyUserAuthentication;
import java.net.Proxy;
import java.util.Map;
import org.apache.commons.lang3.ArrayUtils;
import org.jackhuang.hellominecraftlauncher.apis.handlers.Login;
import org.jackhuang.hellominecraftlauncher.apis.handlers.LoginInfo;
import org.jackhuang.hellominecraftlauncher.apis.handlers.LoginResult;
import org.jackhuang.hellominecraftlauncher.apis.Selector;
import org.jackhuang.hellominecraftlauncher.utilities.C;
/**
*
* @author hyh
*/
public class LegacyLogin extends Login {
LegacyAuthenticationService service;
LegacyUserAuthentication ua;
public LegacyLogin(String clientToken) {
super(clientToken);
service = new LegacyAuthenticationService(Proxy.NO_PROXY);
ua = (LegacyUserAuthentication) service.createUserAuthentication(Agent.MINECRAFT);
}
@Override
public LoginResult login(LoginInfo info) {
String usr = info.username;
String pwd = info.password;
if(ua.isLoggedIn()) ua.logOut();
ua.setPassword(pwd);
ua.setUsername(usr);
return loginBySettings();
}
@Override
public String getName() {
return C.I18N.getString("LegacyLogin");
}
@Override
public boolean isHidePasswordBox() {
return false;
}
@Override
public LoginResult loginBySettings() {
LoginResult result = new LoginResult();
try {
ua.logIn();
if(!ua.canPlayOnline()) throw new Exception(C.I18N.getString("WrongPassword"));
GameProfile selectedProfile = ua.getSelectedProfile();
GameProfile[] profiles = ua.getAvailableProfiles();
String[] names;
String username;
if(selectedProfile == null) {
if(ArrayUtils.isNotEmpty(profiles)) {
names = new String[profiles.length];
for(int i = 0; i < profiles.length; i++) {
names[i] = profiles[i].getName();
}
Selector s = new Selector(null, true, names, C.I18N.getString("PleaseChooseCharacter"));
s.setVisible(true);
username = names[s.sel];
} else {
throw new Exception(C.I18N.getString("NoCharacter"));
}
} else {
username = selectedProfile.getName();
}
result.username = username;
result.success = true;
result.userId = ua.getUserID();
result.accessToken = result.session = ua.getAuthenticatedToken();
} catch (Exception ex) {
result.error = ex.getMessage();
result.success = false;
result.username = ua.getUserID();
}
result.userType = "Legacy";
return result;
}
@Override
public void logout() {
ua.logOut();
}
@Override
public void onLoadSettings(Map settings) {
if(settings == null) return;
ua.loadFromStorage(settings);
}
@Override
public Map onSaveSettings() {
return ua.saveForStorage();
}
}
@@ -0,0 +1,18 @@
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package org.jackhuang.hellominecraftlauncher.plugin.logins;
import java.util.Map;
/**
*
* @author hyh
*/
public class LoginPluginSettings {
public Map legacy, yggdrasil;
public int assetsType;
}
@@ -0,0 +1,117 @@
package org.jackhuang.hellominecraftlauncher.plugin.logins;
import java.security.MessageDigest;
import org.jackhuang.hellominecraftlauncher.apis.handlers.Login;
import org.jackhuang.hellominecraftlauncher.apis.handlers.LoginInfo;
import org.jackhuang.hellominecraftlauncher.apis.handlers.LoginResult;
import org.jackhuang.hellominecraftlauncher.apis.Plugin;
import org.jackhuang.hellominecraftlauncher.utilities.C;
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
/**
*
* @author hyh
*/
public class MineLogin extends Login {
private static final char e[] = {
'0', '1', '2', '3', '4', '5', '6', '7', '8', '9',
'a', 'b', 'c', 'd', 'e', 'f'
};
public static String hash(String type, String source) {
try {
StringBuilder stringbuilder;
MessageDigest md = MessageDigest.getInstance(type);
md.update(source.getBytes());
byte[] bytes = md.digest();
int s2 = bytes.length;
stringbuilder = new StringBuilder(s2 << 1);
for (int i1 = 0; i1 < s2; i1++) {
stringbuilder.append(e[bytes[i1] >> 4 & 0xf]);
stringbuilder.append(e[bytes[i1] & 0xf]);
}
return stringbuilder.toString();
} catch (Exception e) {
e.printStackTrace();
return "";
}
}
public MineLogin(String clientToken) {
super(clientToken);
}
@Override
public LoginResult login(LoginInfo info) {
String usr = info.username.toLowerCase();
String pwd = info.password;
String str = hash("SHA1", usr);
String hashCode = hash("MD5", pwd);
String data = org.jackhuang.hellominecraftlauncher.apis.HttpGet.sendGetRequest(
"http://www.minelogin.cc/ml/login.php",
"username=" + usr + "&hash=" + hashCode + "&launcher=HelloMinecraftLauncher");
LoginResult req = new LoginResult();
req.username = usr;
req.session = req.userId = req.accessToken = "minelogin";
try {
int requestNumber = Integer.parseInt(data);
req.success = false;
java.util.ResourceBundle bundle = C.I18N; // NOI18N
switch(requestNumber) {
case 0:
req.error = bundle.getString("MineLogin0");
break;
case 1:
req.error = bundle.getString("MineLogin1");
break;
case 2:
req.error = bundle.getString("MineLogin2");
break;
case 3:
req.error = bundle.getString("MineLogin3");
break;
case 4:
req.error = bundle.getString("MineLogin4");
break;
case 5:
req.error = bundle.getString("MineLogin5");
break;
case 100:
req.success = true;
break;
default:
req.error = "Unkown result: " + data;
break;
}
} catch(Exception e) {
e.printStackTrace();
req.success = false;
req.error = data;
}
req.userType = "MineLogin";
return req;
}
@Override
public String getName() {
return "MineLogin";
}
@Override
public LoginResult loginBySettings() {
return null;
}
@Override
public void logout() {
}
}
@@ -0,0 +1,53 @@
package org.jackhuang.hellominecraftlauncher.plugin.logins;
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
import org.jackhuang.hellominecraftlauncher.apis.handlers.Login;
import org.jackhuang.hellominecraftlauncher.apis.handlers.LoginInfo;
import org.jackhuang.hellominecraftlauncher.apis.handlers.LoginResult;
import org.jackhuang.hellominecraftlauncher.utilities.C;
/**
*
* @author hyh
*/
public class OfflineLogin extends Login {
public OfflineLogin(String clientToken) {
super(clientToken);
}
@Override
public LoginResult login(LoginInfo info) {
LoginResult result = new LoginResult();
result.success = true;
result.username = info.username;
result.session = result.userId = result.accessToken = "no";
result.userType = "Offline";
return result;
}
@Override
public String getName() {
return C.I18N.getString("OfflineLogin");
}
@Override
public boolean isHidePasswordBox() {
return true;
}
@Override
public LoginResult loginBySettings() {
return null;
}
@Override
public void logout() {
}
}
@@ -0,0 +1,128 @@
package org.jackhuang.hellominecraftlauncher.plugin.logins;
import java.security.MessageDigest;
import org.jackhuang.hellominecraftlauncher.apis.handlers.Login;
import org.jackhuang.hellominecraftlauncher.apis.handlers.LoginInfo;
import org.jackhuang.hellominecraftlauncher.apis.handlers.LoginResult;
import org.jackhuang.hellominecraftlauncher.apis.Selector;
import org.jackhuang.hellominecraftlauncher.utilities.C;
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
/**
*
* @author hyh
*/
public class SkinmeLogin extends Login {
public SkinmeLogin(String clientToken) {
super(clientToken);
}
private static final char e[] = {
'0', '1', '2', '3', '4', '5', '6', '7', '8', '9',
'a', 'b', 'c', 'd', 'e', 'f'
};
public static String hash(String type, String source) {
try {
StringBuilder stringbuilder;
MessageDigest md = MessageDigest.getInstance(type);
md.update(source.getBytes());
byte[] bytes = md.digest();
int s2 = bytes.length;
stringbuilder = new StringBuilder(s2 << 1);
for (int i1 = 0; i1 < s2; i1++) {
stringbuilder.append(e[bytes[i1] >> 4 & 0xf]);
stringbuilder.append(e[bytes[i1] & 0xf]);
}
return stringbuilder.toString();
} catch (Exception e) {
e.printStackTrace();
return "";
}
}
public String[] parseType1(String s) {
return s.split(",");
}
public String getCharacter(String user, String hash, String $char) {
if($char == null) {
return org.jackhuang.hellominecraftlauncher.apis.HttpGet.sendGetRequest(
"http://www.skinme.cc/api/login.php", "user=" + user + "&hash=" + hash);
} else {
return org.jackhuang.hellominecraftlauncher.apis.HttpGet.sendGetRequest(
"http://www.skinme.cc/api/login.php", "user=" + user + "&hash=" + hash + "&char=" + $char);
}
}
@Override
public LoginResult login(LoginInfo info) {
String usr = info.username.toLowerCase();
String pwd = info.password;
String str = hash("SHA1", usr);
String hashCode = hash("SHA1", hash("MD5", hash("SHA1", pwd) + pwd) + str);
System.out.println("hashCode=" + hashCode);
String data = getCharacter(usr, hashCode, null);
String[] sl = data.split(":");
LoginResult req = new LoginResult();
if("0".equals(sl[0])) {
req.success = false;
req.error = sl[1];
} else if("1".equals(sl[0])) {
req.success = true;
String[] s = parseType1(sl[1]);
req.username = s[0];
req.session = req.userId = req.accessToken = s[1];
} else if("2".equals(sl[0])) {
req.success = true;
String[] charators = sl[1].split(";");
int len = charators.length;
String[] $char = new String[len];
String[] user = new String[len];
System.out.println(sl[1]);
for(int i = 0; i < len; i++) {
String[] charator = charators[i].split(",");
$char[i] = charator[0];
user[i] = charator[1];
}
Selector s = new Selector(null, true, user, C.I18N.getString("PleaseChooseCharacter"));
s.setVisible(true);
if(s.sel == Selector.failedToSel) {
req.success = false;
req.error = "Canceled";
} else {
int index = s.sel;
String character = $char[index];
sl = getCharacter(usr, hashCode, character).split(":");
String[] s2 = parseType1(sl[1]);
req.username = s2[0];
req.session = req.userId = req.accessToken = s2[1];
}
}
req.userType = "Skinme";
return req;
}
@Override
public String getName() {
return "Skinme";
}
@Override
public LoginResult loginBySettings() {
return null;
}
@Override
public void logout() {
}
}
@@ -0,0 +1,135 @@
package org.jackhuang.hellominecraftlauncher.plugin.logins;
import com.google.gson.Gson;
import com.mojang.authlib.Agent;
import com.mojang.authlib.GameProfile;
import com.mojang.authlib.yggdrasil.YggdrasilAuthenticationService;
import com.mojang.authlib.yggdrasil.YggdrasilUserAuthentication;
import com.mojang.authlib.yggdrasil.request.NameValue;
import java.net.Proxy;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;
import javax.swing.JOptionPane;
import org.apache.commons.lang3.ArrayUtils;
import org.jackhuang.hellominecraftlauncher.apis.handlers.Login;
import org.jackhuang.hellominecraftlauncher.apis.handlers.LoginInfo;
import org.jackhuang.hellominecraftlauncher.apis.handlers.LoginResult;
import org.jackhuang.hellominecraftlauncher.apis.Selector;
import org.jackhuang.hellominecraftlauncher.utilities.C;
/**
*
* @author hyh
*/
public class YggdrasilLogin extends Login {
YggdrasilAuthenticationService service;
YggdrasilUserAuthentication ua;
public YggdrasilLogin(String clientToken) {
super(clientToken);
service = new YggdrasilAuthenticationService(Proxy.NO_PROXY, clientToken);
ua = (YggdrasilUserAuthentication)service.createUserAuthentication(Agent.MINECRAFT);
}
@Override
public LoginResult login(LoginInfo info) {
String usr = info.username;
String pwd = info.password;
ua.setPassword(pwd);
ua.setUsername(usr);
LoginResult result = new LoginResult();
try {
ua.logIn();
if(!ua.isLoggedIn()) throw new Exception(C.I18N.getString("WrongPassword"));
GameProfile selectedProfile = ua.getSelectedProfile();
GameProfile[] profiles = ua.getAvailableProfiles();
String[] names;
String username;
if(selectedProfile == null) {
if(ArrayUtils.isNotEmpty(profiles)) {
names = new String[profiles.length];
for(int i = 0; i < profiles.length; i++) {
names[i] = profiles[i].getName();
}
Selector s = new Selector(null, true, names, C.I18N.getString("PleaseChooseCharacter"));
s.setVisible(true);
username = names[s.sel];
} else {
username = JOptionPane.showInputDialog(C.I18N.getString("NoCharacter"));
}
} else {
username = selectedProfile.getName();
}
result.username = username;
result.success = true;
result.userId = ua.getUserID();
ArrayList<NameValue> al = ua.getUser().getProperties();
HashMap<String, ArrayList<String>> userProperties = new HashMap<String, ArrayList<String>>();
if(al != null && !al.isEmpty()) {
for(NameValue nv : al) {
ArrayList<String> al2 = new ArrayList<String>();
al2.add(nv.value);
userProperties.put(nv.name, al2);
}
}
result.userProperties = new Gson().toJson(userProperties);
result.accessToken = result.session = ua.getAuthenticatedToken();
} catch (Exception ex) {
result.error = ex.getMessage();
result.success = false;
result.username = ua.getUserID();
}
result.userType = "Legacy";
return result;
}
@Override
public boolean isLoggedIn() {
return ua.isLoggedIn();
}
@Override
public String getName() {
return C.I18N.getString("YggdrasilLogin");
}
@Override
public Map onSaveSettings() {
return ua.saveForStorage();
}
@Override
public void onLoadSettings(Map settings) {
if(settings == null) return;
ua.loadFromStorage(settings);
}
@Override
public LoginResult loginBySettings() {
LoginResult info = new LoginResult();
try {
ua.logIn();
if(!ua.isLoggedIn()) throw new Exception(C.I18N.getString("WrongPassword"));
GameProfile profile = ua.getSelectedProfile();
info.username = profile.getName();
info.success = true;
info.userId = profile.getId();
info.accessToken = ua.getAuthenticatedToken();
} catch (Exception ex) {
info.error = ex.getMessage();
info.success = false;
info.username = ua.getUserID();
}
return info;
}
@Override
public void logout() {
ua.logOut();
}
}
@@ -0,0 +1,118 @@
<?xml version="1.0" encoding="UTF-8" ?>
<Form version="1.5" maxVersion="1.8" type="org.netbeans.modules.form.forminfo.JPanelFormInfo">
<AuxValues>
<AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="0"/>
<AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/>
<AuxValue name="FormSettings_generateFQN" type="java.lang.Boolean" value="true"/>
<AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="false"/>
<AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="false"/>
<AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="1"/>
<AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/>
<AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/>
<AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/>
</AuxValues>
<Layout>
<DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0">
<EmptySpace min="0" pref="406" max="32767" attributes="0"/>
<Group type="103" rootIndex="1" groupAlignment="0" attributes="0">
<Component id="pnlGameDownloads" alignment="1" max="32767" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
<DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0">
<EmptySpace min="0" pref="319" max="32767" attributes="0"/>
<Group type="103" rootIndex="1" groupAlignment="0" attributes="0">
<Component id="pnlGameDownloads" alignment="1" max="32767" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
</Layout>
<SubComponents>
<Container class="javax.swing.JPanel" name="pnlGameDownloads">
<Layout>
<DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Component id="jScrollPane2" pref="258" max="32767" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" max="-2" attributes="0">
<Component id="btnDownload" alignment="1" pref="122" max="32767" attributes="0"/>
<Component id="btnRefresh" alignment="1" max="32767" attributes="0"/>
</Group>
<EmptySpace max="-2" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
<DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<Component id="btnRefresh" min="-2" max="-2" attributes="0"/>
<EmptySpace max="32767" attributes="0"/>
<Component id="btnDownload" min="-2" max="-2" attributes="0"/>
</Group>
<Component id="jScrollPane2" alignment="0" pref="299" max="32767" attributes="0"/>
</Group>
<EmptySpace max="-2" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
</Layout>
<SubComponents>
<Component class="javax.swing.JButton" name="btnDownload">
<Properties>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="org/jackhuang/hellominecraftlauncher/I18N.properties" key="&#x4e0b;&#x8f7d;" replaceFormat="java.util.ResourceBundle.getBundle(&quot;{bundleNameSlashes}&quot;).getString(&quot;{key}&quot;)"/>
</Property>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnDownloadActionPerformed"/>
</Events>
</Component>
<Container class="javax.swing.JScrollPane" name="jScrollPane2">
<AuxValues>
<AuxValue name="autoScrollPane" type="java.lang.Boolean" value="true"/>
</AuxValues>
<Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/>
<SubComponents>
<Component class="javax.swing.JTable" name="lstDownloads">
<Properties>
<Property name="model" type="javax.swing.table.TableModel" editor="org.netbeans.modules.form.editors2.TableModelEditor">
<Table columnCount="4" rowCount="0">
<Column editable="false" title="&#x7248;&#x672c;" type="java.lang.String"/>
<Column editable="false" title="&#x53d1;&#x5e03;&#x65f6;&#x95f4;" type="java.lang.String"/>
<Column editable="false" title="&#x91ca;&#x653e;&#x65f6;&#x95f4;" type="java.lang.String"/>
<Column editable="false" title="&#x7c7b;&#x578b;" type="java.lang.String"/>
</Table>
</Property>
<Property name="toolTipText" type="java.lang.String" value=""/>
<Property name="tableHeader" type="javax.swing.table.JTableHeader" editor="org.netbeans.modules.form.editors2.JTableHeaderEditor">
<TableHeader reorderingAllowed="true" resizingAllowed="true"/>
</Property>
</Properties>
</Component>
</SubComponents>
</Container>
<Component class="javax.swing.JButton" name="btnRefresh">
<Properties>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="org/jackhuang/hellominecraftlauncher/I18N.properties" key="&#x5237;&#x65b0;" replaceFormat="java.util.ResourceBundle.getBundle(&quot;{bundleNameSlashes}&quot;).getString(&quot;{key}&quot;)"/>
</Property>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnRefreshActionPerformed"/>
</Events>
</Component>
</SubComponents>
</Container>
</SubComponents>
</Form>
@@ -0,0 +1,221 @@
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package org.jackhuang.hellominecraftlauncher.plugin.mainpanels;
import com.google.gson.Gson;
import java.io.File;
import javax.swing.table.DefaultTableModel;
import org.jackhuang.hellominecraftlauncher.apis.DoneListener;
import org.jackhuang.hellominecraftlauncher.apis.DownloadWindow;
import org.jackhuang.hellominecraftlauncher.apis.utils.Utils;
import org.jackhuang.hellominecraftlauncher.apis.version.MinecraftVersion;
import org.jackhuang.hellominecraftlauncher.download.URLGetThread;
import org.jackhuang.hellominecraftlauncher.loaders.MinecraftVersions;
import org.jackhuang.hellominecraftlauncher.loaders.MinecraftVersionsLoader;
import org.jackhuang.hellominecraftlauncher.plugin.HMCLPlugin;
import org.jackhuang.hellominecraftlauncher.utilities.C;
/**
*
* @author hyh
*/
public class GameDownloadPanel extends javax.swing.JPanel {
/**
* Creates new form GameDownloadPanel
*/
public GameDownloadPanel() {
initComponents();
setName(C.I18N.getString("GameDownload"));
String[] titleA = new String[]{C.I18N.getString("Version"), C.I18N.getString("Time"), C.I18N.getString("ReleaseTime"), C.I18N.getString("Type")};
Class[] typesA = new Class[]{String.class,String.class,String.class,String.class};
boolean[] canEditA = new boolean[]{false,false,false,false};
lstDownloads.setModel(Utils.makeDefaultTableModel(titleA, typesA, canEditA));
}
/**
* This method is called from within the constructor to initialize the form.
* WARNING: Do NOT modify this code. The content of this method is always
* regenerated by the Form Editor.
*/
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
pnlGameDownloads = new javax.swing.JPanel();
btnDownload = new javax.swing.JButton();
jScrollPane2 = new javax.swing.JScrollPane();
lstDownloads = new javax.swing.JTable();
btnRefresh = new javax.swing.JButton();
java.util.ResourceBundle bundle = java.util.ResourceBundle.getBundle("org/jackhuang/hellominecraftlauncher/I18N"); // NOI18N
btnDownload.setText(bundle.getString("下载")); // NOI18N
btnDownload.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnDownloadActionPerformed(evt);
}
});
lstDownloads.setModel(new javax.swing.table.DefaultTableModel(
new Object [][] {
},
new String [] {
"版本", "发布时间", "释放时间", "类型"
}
) {
Class[] types = new Class [] {
java.lang.String.class, java.lang.String.class, java.lang.String.class, java.lang.String.class
};
boolean[] canEdit = new boolean [] {
false, false, false, false
};
public Class getColumnClass(int columnIndex) {
return types [columnIndex];
}
public boolean isCellEditable(int rowIndex, int columnIndex) {
return canEdit [columnIndex];
}
});
lstDownloads.setToolTipText("");
jScrollPane2.setViewportView(lstDownloads);
btnRefresh.setText(bundle.getString("刷新")); // NOI18N
btnRefresh.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnRefreshActionPerformed(evt);
}
});
javax.swing.GroupLayout pnlGameDownloadsLayout = new javax.swing.GroupLayout(pnlGameDownloads);
pnlGameDownloads.setLayout(pnlGameDownloadsLayout);
pnlGameDownloadsLayout.setHorizontalGroup(
pnlGameDownloadsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(pnlGameDownloadsLayout.createSequentialGroup()
.addContainerGap()
.addComponent(jScrollPane2, javax.swing.GroupLayout.DEFAULT_SIZE, 258, Short.MAX_VALUE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(pnlGameDownloadsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
.addComponent(btnDownload, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 122, Short.MAX_VALUE)
.addComponent(btnRefresh, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addContainerGap())
);
pnlGameDownloadsLayout.setVerticalGroup(
pnlGameDownloadsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(pnlGameDownloadsLayout.createSequentialGroup()
.addContainerGap()
.addGroup(pnlGameDownloadsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(pnlGameDownloadsLayout.createSequentialGroup()
.addComponent(btnRefresh)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(btnDownload))
.addComponent(jScrollPane2, javax.swing.GroupLayout.DEFAULT_SIZE, 299, Short.MAX_VALUE))
.addContainerGap())
);
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
this.setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGap(0, 406, Short.MAX_VALUE)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(pnlGameDownloads, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGap(0, 319, Short.MAX_VALUE)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(pnlGameDownloads, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
}// </editor-fold>//GEN-END:initComponents
private void btnDownloadActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnDownloadActionPerformed
downloadMinecraft(HMCLPlugin.env.getSourceType());
}//GEN-LAST:event_btnDownloadActionPerformed
private void btnRefreshActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnRefreshActionPerformed
refreshDownloads(HMCLPlugin.env.getSourceType());
}//GEN-LAST:event_btnRefreshActionPerformed
public void refreshDownloads(int index) {
clearListDownloads();
URLGetThread thread = new URLGetThread(C.URL_VERSIONLIST[index], "utf-8");
thread.addListener(new RefreshDownloadsDone());
thread.start();
}
void clearListDownloads() {
DefaultTableModel model = (DefaultTableModel) lstDownloads.getModel();
while (model.getRowCount() > 0) {
model.removeRow(0);
}
lstDownloads.updateUI();
}
void downloadMinecraft(int index) {
String id = (String) lstDownloads.getModel().getValueAt(lstDownloads.getSelectedRow(), 0);
String vurl = C.URL_VERSIONS[index] + id + "/";
String vpath = HMCLPlugin.env.getDefaultGameDir() + File.separator + "versions" + File.separator + id + File.separator;
String mvt = vpath + id + ".json";
String mvj = vpath + id + ".jar";
new File(vpath).mkdirs();
new File(mvt).delete();
new File(mvj).delete();
/*DownloadAllThread dat = new DownloadAllThread(new ProgressListener(id));
dat.addDownloadURL("", vurl + id + ".json", vpath + id + ".json");
dat.addDownloadURL("", vurl + id + ".jar", vpath + id + ".jar");
dat.start();*/
DownloadWindow dw = new DownloadWindow();
dw.addDownloadURL(id + ".json", vurl + id + ".json", mvt);
dw.addDownloadURL(id + ".jar", vurl + id + ".jar", mvj);
dw.setVisible(true);
if(dw.isDownloadSuccessfully()) {
String aurl = C.URL_INDEXES[index];
String apath = HMCLPlugin.env.getDefaultGameDir() + File.separator + "assets" + File.separator + "indexes" + File.separator;
Gson gson = new Gson();
MinecraftVersion mv = gson.fromJson(Utils.readToEnd(new File(mvt)), MinecraftVersion.class);
new File(apath).mkdirs();
new File(apath + mv.assets + ".json").delete();
dw = new DownloadWindow();
dw.addDownloadURL(mv.assets + ".json", aurl + mv.assets + ".json", apath + mv.assets + ".json");
dw.setVisible(true);
}
}
class RefreshDownloadsDone implements DoneListener<String, Object> {
@Override
public void onDone(String result, Object value2) {
javax.swing.JTable table = lstDownloads;
DefaultTableModel model = (DefaultTableModel) table.getModel();
MinecraftVersionsLoader loader = new MinecraftVersionsLoader(result);
MinecraftVersions v = loader.getVersions();
for (MinecraftVersion ver : v.versions) {
String[] line = new String[4];
line[0] = ver.id;
line[1] = ver.releaseTime;
line[2] = ver.time;
line[3] = ver.type;
model.addRow(line);
}
}
}
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JButton btnDownload;
private javax.swing.JButton btnRefresh;
private javax.swing.JScrollPane jScrollPane2;
private javax.swing.JTable lstDownloads;
private javax.swing.JPanel pnlGameDownloads;
// End of variables declaration//GEN-END:variables
}
@@ -0,0 +1,98 @@
<?xml version="1.0" encoding="UTF-8" ?>
<Form version="1.6" maxVersion="1.8" type="org.netbeans.modules.form.forminfo.JPanelFormInfo">
<AuxValues>
<AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="0"/>
<AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/>
<AuxValue name="FormSettings_generateFQN" type="java.lang.Boolean" value="true"/>
<AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="false"/>
<AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="false"/>
<AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="1"/>
<AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/>
<AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/>
<AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/>
</AuxValues>
<Layout>
<DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Component id="jScrollPane2" pref="252" max="32767" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" max="-2" attributes="0">
<Component id="btnDownload" alignment="1" pref="122" max="32767" attributes="0"/>
<Component id="btnRefresh" alignment="1" max="32767" attributes="0"/>
</Group>
<EmptySpace max="-2" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
<DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<Component id="btnRefresh" min="-2" max="-2" attributes="0"/>
<EmptySpace max="32767" attributes="0"/>
<Component id="btnDownload" min="-2" max="-2" attributes="0"/>
</Group>
<Component id="jScrollPane2" alignment="0" pref="280" max="32767" attributes="0"/>
</Group>
<EmptySpace max="-2" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
</Layout>
<SubComponents>
<Container class="javax.swing.JScrollPane" name="jScrollPane2">
<AuxValues>
<AuxValue name="autoScrollPane" type="java.lang.Boolean" value="true"/>
</AuxValues>
<Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/>
<SubComponents>
<Component class="javax.swing.JTable" name="lstDownloads">
<Properties>
<Property name="model" type="javax.swing.table.TableModel" editor="org.netbeans.modules.form.editors2.TableModelEditor">
<Table columnCount="4" rowCount="0">
<Column editable="false" title="&#x6574;&#x5408;&#x5305;&#x540d;&#x79f0;" type="java.lang.String"/>
<Column editable="false" title="&#x6574;&#x5408;&#x5305;&#x7248;&#x672c;" type="java.lang.String"/>
<Column editable="false" title="MC&#x7248;&#x672c;" type="java.lang.String"/>
<Column editable="false" title="&#x4f5c;&#x8005;" type="java.lang.String"/>
</Table>
</Property>
<Property name="toolTipText" type="java.lang.String" value=""/>
<Property name="selectionModel" type="javax.swing.ListSelectionModel" editor="org.netbeans.modules.form.editors2.JTableSelectionModelEditor">
<JTableSelectionModel selectionMode="0"/>
</Property>
<Property name="tableHeader" type="javax.swing.table.JTableHeader" editor="org.netbeans.modules.form.editors2.JTableHeaderEditor">
<TableHeader reorderingAllowed="true" resizingAllowed="true"/>
</Property>
</Properties>
</Component>
</SubComponents>
</Container>
<Component class="javax.swing.JButton" name="btnRefresh">
<Properties>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="org/jackhuang/hellominecraftlauncher/I18N.properties" key="&#x5237;&#x65b0;" replaceFormat="java.util.ResourceBundle.getBundle(&quot;{bundleNameSlashes}&quot;).getString(&quot;{key}&quot;)"/>
</Property>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnRefreshActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JButton" name="btnDownload">
<Properties>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="org/jackhuang/hellominecraftlauncher/I18N.properties" key="&#x4e0b;&#x8f7d;" replaceFormat="java.util.ResourceBundle.getBundle(&quot;{bundleNameSlashes}&quot;).getString(&quot;{key}&quot;)"/>
</Property>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnDownloadActionPerformed"/>
</Events>
</Component>
</SubComponents>
</Form>
@@ -0,0 +1,181 @@
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package org.jackhuang.hellominecraftlauncher.plugin.mainpanels;
import com.google.gson.Gson;
import javax.swing.table.DefaultTableModel;
import org.jackhuang.hellominecraftlauncher.apis.DoingLongTaskDialog;
import org.jackhuang.hellominecraftlauncher.apis.DoneListener;
import org.jackhuang.hellominecraftlauncher.apis.DownloadWindow;
import org.jackhuang.hellominecraftlauncher.apis.utils.Compressor;
import org.jackhuang.hellominecraftlauncher.apis.utils.Utils;
import org.jackhuang.hellominecraftlauncher.download.URLGetThread;
import org.jackhuang.hellominecraftlauncher.loaders.packages.Packages;
import org.jackhuang.hellominecraftlauncher.plugin.HMCLPlugin;
import org.jackhuang.hellominecraftlauncher.utilities.C;
/**
*
* @author hyh
*/
public class IntegrateDownloadPanel extends javax.swing.JPanel implements DoneListener<String, Object> {
/**
* Creates new form IntegrateDownloadPanel
*/
public IntegrateDownloadPanel() {
initComponents();
setName(C.I18N.getString("IntegrateDownload"));
String[] titleA = new String[]{C.I18N.getString("IntegrateName"), C.I18N.getString("IntegrateVersion"), C.I18N.getString("Version"), C.I18N.getString("Authors")};
Class[] typesA = new Class[]{String.class, String.class, String.class, String.class};
boolean[] canEditA = new boolean[]{false,false,false,false};
lstDownloads.setModel(Utils.makeDefaultTableModel(titleA, typesA, canEditA));
}
/**
* This method is called from within the constructor to initialize the form.
* WARNING: Do NOT modify this code. The content of this method is always
* regenerated by the Form Editor.
*/
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
jScrollPane2 = new javax.swing.JScrollPane();
lstDownloads = new javax.swing.JTable();
btnRefresh = new javax.swing.JButton();
btnDownload = new javax.swing.JButton();
lstDownloads.setModel(new javax.swing.table.DefaultTableModel(
new Object [][] {
},
new String [] {
"整合包名称", "整合包版本", "MC版本", "作者"
}
) {
Class[] types = new Class [] {
java.lang.String.class, java.lang.String.class, java.lang.String.class, java.lang.String.class
};
boolean[] canEdit = new boolean [] {
false, false, false, false
};
public Class getColumnClass(int columnIndex) {
return types [columnIndex];
}
public boolean isCellEditable(int rowIndex, int columnIndex) {
return canEdit [columnIndex];
}
});
lstDownloads.setToolTipText("");
lstDownloads.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);
jScrollPane2.setViewportView(lstDownloads);
java.util.ResourceBundle bundle = java.util.ResourceBundle.getBundle("org/jackhuang/hellominecraftlauncher/I18N"); // NOI18N
btnRefresh.setText(bundle.getString("刷新")); // NOI18N
btnRefresh.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnRefreshActionPerformed(evt);
}
});
btnDownload.setText(bundle.getString("下载")); // NOI18N
btnDownload.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnDownloadActionPerformed(evt);
}
});
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
this.setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addComponent(jScrollPane2, javax.swing.GroupLayout.DEFAULT_SIZE, 252, Short.MAX_VALUE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
.addComponent(btnDownload, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 122, Short.MAX_VALUE)
.addComponent(btnRefresh, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addContainerGap())
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addComponent(btnRefresh)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(btnDownload))
.addComponent(jScrollPane2, javax.swing.GroupLayout.DEFAULT_SIZE, 280, Short.MAX_VALUE))
.addContainerGap())
);
}// </editor-fold>//GEN-END:initComponents
private void btnRefreshActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnRefreshActionPerformed
refreshDownloads();
}//GEN-LAST:event_btnRefreshActionPerformed
private void btnDownloadActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnDownloadActionPerformed
downloadMinecraft();
}//GEN-LAST:event_btnDownloadActionPerformed
private void refreshDownloads() {
URLGetThread thread = new URLGetThread(C.URL_INTEGRATE + "packages.json", "utf-8");
thread.addListener(this);
thread.start();
}
private void loadDownloads() {
DefaultTableModel model = (DefaultTableModel)lstDownloads.getModel();
while(model.getRowCount() > 0)
model.removeRow(0);
for(Packages p : packages) {
model.addRow(new Object[] {
p.name, p.version, p.mcversion, p.author
});
}
lstDownloads.updateUI();
}
private void downloadMinecraft() {
int index = lstDownloads.getSelectedRow();
Packages p = packages[index];
DownloadWindow dw = new DownloadWindow();
final String filename = p.type + '-' + p.version + ".zip";
String url = C.URL_INTEGRATE + p.type + '/' + filename;
dw.addDownloadURL(p.name + ' ' + p.version, url, filename);
dw.setVisible(true);
if(dw.isDownloadSuccessfully()) {
DoingLongTaskDialog dialog = new DoingLongTaskDialog(null, true, new DoneListener<Object, Object>() {
@Override
public void onDone(Object value, Object value2) {
Compressor.unzip(filename, HMCLPlugin.env.getDefaultGameDir());
}
}, null);
dialog.setVisible(true);
}
}
@Override
public void onDone(String value, Object value2) {
packages = new Gson().fromJson(value, Packages[].class);
loadDownloads();
}
Packages[] packages;
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JButton btnDownload;
private javax.swing.JButton btnRefresh;
private javax.swing.JScrollPane jScrollPane2;
private javax.swing.JTable lstDownloads;
// End of variables declaration//GEN-END:variables
}
@@ -0,0 +1,99 @@
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package org.jackhuang.hellominecraftlauncher.plugin.settings;
import java.io.File;
import java.util.ArrayList;
import java.util.Map;
import org.jackhuang.hellominecraftlauncher.apis.DoneListener;
import org.jackhuang.hellominecraftlauncher.apis.DownloadWindow;
import org.jackhuang.hellominecraftlauncher.apis.handlers.IAssetsHandler;
import org.jackhuang.hellominecraftlauncher.apis.utils.Utils;
import org.jackhuang.hellominecraftlauncher.plugin.HMCLPlugin;
import org.jackhuang.hellominecraftlauncher.plugin.settings.assets.Contents;
import org.jackhuang.hellominecraftlauncher.plugin.settings.assets.NewAssetsLoader;
import org.jackhuang.hellominecraftlauncher.plugin.settings.assets.Objects;
import org.jackhuang.hellominecraftlauncher.plugin.settings.assets.ObjectsItem;
import org.jackhuang.hellominecraftlauncher.settings.Version;
/**
*
* @author hyh
*/
public class AssetsMojangLoader extends IAssetsHandler {
ArrayList<DoneListener<Integer, Integer>> listeners = new ArrayList<DoneListener<Integer, Integer>>();
private ArrayList<String> assetsDownloadURLs, assetsLocalNames;
private String url_assets, name;
public AssetsMojangLoader(String URLASSETS, String name) {
url_assets = URLASSETS;
this.name = name;
}
@Override
public String getName() {
return name;
}
@Override
public void getList(final DoneListener<String[], Void> dl) {
Version v = HMCLPlugin.env.getVersion();
String assetsIndex = Utils.getMinecraftVersion(v, HMCLPlugin.env.getDefaultGameDir()).assets;
File f = new File(Utils.addSeparator(assets) + File.separator + "indexes" + File.separator + assetsIndex + ".json");
NewAssetsLoader loader = new NewAssetsLoader(Utils.readToEnd(f));
Objects o = loader.format();
assetsDownloadURLs = new ArrayList<String>();
assetsLocalNames = new ArrayList<String>();
ArrayList<String> al = new ArrayList<String>();
for (Map.Entry<String, ObjectsItem> e : o.objects.entrySet()) {
Contents c = new Contents();
c.key = e.getValue().hash.substring(0, 2) + "/" + e.getValue().hash;
assetsDownloadURLs.add(c.key);
assetsLocalNames.add(c.key);
al.add(e.getKey());
}
dl.onDone(al.toArray(new String[1]), null);
}
void onEvent() {
for (DoneListener<Integer, Integer> dl : listeners) {
dl.onDone(progress, max);
}
}
int progress, max;
@Override
public void beginDownloading() {
Version version = HMCLPlugin.env.getVersion();
String path = Utils.getGameDir(version, HMCLPlugin.env.getDefaultGameDir());
String path3 = assets;
String assetsDir = Utils.addSeparator(path3);
File assetsFile = new File(assetsDir);
if (!assetsFile.exists()) {
assetsFile.mkdirs();
}
progress = 0;
for (int i = 0; i < assetsDownloadURLs.size(); i++) {
File file = new File(assetsDir + "objects" + File.separator + assetsLocalNames.get(i).replace("/", File.separator));
if (!file.getParentFile().exists()) {
file.getParentFile().mkdirs();
}
}
max = assetsDownloadURLs.size();
DownloadWindow dw = new DownloadWindow();
for (int i = 0; i < max; i++) {
String mark = assetsDownloadURLs.get(i);
String url = url_assets + mark;
String location = assetsDir + "objects" + File.separator + assetsLocalNames.get(i).replace("/", File.separator);
if (new File(location).isDirectory()) {
continue;
}
dw.addDownloadURL(mark, url, location);
}
dw.setVisible(true);
}
}
@@ -0,0 +1,95 @@
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package org.jackhuang.hellominecraftlauncher.plugin.settings;
import java.io.File;
import java.util.ArrayList;
import java.util.Map;
import org.jackhuang.hellominecraftlauncher.apis.DoneListener;
import org.jackhuang.hellominecraftlauncher.apis.DownloadWindow;
import org.jackhuang.hellominecraftlauncher.apis.handlers.IAssetsHandler;
import org.jackhuang.hellominecraftlauncher.apis.utils.Utils;
import org.jackhuang.hellominecraftlauncher.plugin.settings.assets.AssetsLoader;
import org.jackhuang.hellominecraftlauncher.plugin.settings.assets.AssetsLoaderListener;
import org.jackhuang.hellominecraftlauncher.plugin.settings.assets.Contents;
/**
*
* @author hyh
*/
public class AssetsMojangOldLoader extends IAssetsHandler {
ArrayList<DoneListener<Integer, Integer>> listeners = new ArrayList<DoneListener<Integer, Integer>>();
private ArrayList<String> assetsDownloadURLs, assetsLocalNames;
private String url_assets, name;
public AssetsMojangOldLoader(String url, String name) {
url_assets = url;
this.name = name;
}
@Override
public String getName() {
return name;
}
@Override
public void getList(final DoneListener<String[], Void> dl) {
AssetsLoader.getAssets(url_assets, new AssetsLoaderListener() {
@Override
public void OnDone(ArrayList<Contents> loader) {
assetsDownloadURLs = new ArrayList<String>();
assetsLocalNames = new ArrayList<String>();
for (Contents c : loader) {
assetsDownloadURLs.add(c.key);
assetsLocalNames.add(c.key);
}
dl.onDone(assetsLocalNames.toArray(new String[1]), null);
}
@Override
public void OnFailed(Exception e) {
e.printStackTrace();
dl.onDone(new String[]{"获取列表失败,请刷新重试"}, null);
}
});
}
void onEvent() {
for (DoneListener<Integer, Integer> dl : listeners) {
dl.onDone(progress, max);
}
}
int progress, max;
@Override
public void beginDownloading() {
String path3 = assets;
String assetsDir = Utils.addSeparator(path3);
File assetsFile = new File(assetsDir);
if (!assetsFile.exists()) {
assetsFile.mkdirs();
}
progress = 0;
for (int i = 0; i < assetsDownloadURLs.size(); i++) {
File file = new File(assetsDir + assetsLocalNames.get(i).replace("/", File.separator));
if (!file.getParentFile().exists()) {
file.getParentFile().mkdirs();
}
}
max = assetsDownloadURLs.size();
DownloadWindow dw = new DownloadWindow();
for (int i = 0; i < max; i++) {
String mark = assetsDownloadURLs.get(i);
String url = url_assets + mark;
String location = assetsDir + assetsLocalNames.get(i).replace("/", File.separator);
if (new File(location).isDirectory()) {
continue;
}
dw.addDownloadURL(mark, url, location);
}
dw.setVisible(true);
}
}
@@ -0,0 +1,52 @@
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package org.jackhuang.hellominecraftlauncher.plugin.settings;
import java.util.ArrayList;
import org.jackhuang.hellominecraftlauncher.apis.DoneListener;
import org.jackhuang.hellominecraftlauncher.apis.DownloadWindow;
import org.jackhuang.hellominecraftlauncher.apis.handlers.IAssetsHandler;
import org.jackhuang.hellominecraftlauncher.apis.utils.Compressor;
import org.jackhuang.hellominecraftlauncher.apis.utils.Utils;
/**
*
* @author hyh
*/
public class AssetsZipHandler extends IAssetsHandler {
ArrayList<DoneListener<Integer, Integer>> listeners = new ArrayList<DoneListener<Integer, Integer>>();
String name, filename, url;
public AssetsZipHandler(String name, String filename, String url) {
this.name = name;
this.filename = filename;
this.url = url;
}
@Override
public String getName() {
return name;
}
@Override
public void beginDownloading() {
final String filePath = Utils.addSeparator(Utils.currentDir()) + filename;
DownloadWindow dw = new DownloadWindow();
dw.addDownloadURL(filename, url, filePath);
dw.setModal(true);
dw.setVisible(true);
if(dw.isDownloadSuccessfully())
Compressor.unzip(filePath, assets);
}
@Override
public void getList(DoneListener<String[], Void> dl) {
dl.onDone(new String[]{name}, null);
}
}
@@ -0,0 +1,96 @@
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package org.jackhuang.hellominecraftlauncher.plugin.settings.assets;
import java.util.ArrayList;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import org.jackhuang.hellominecraftlauncher.apis.LogUtils;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
/**
*
* @author hyh
*/
public class AssetsLoader {
static class MyThread extends Thread {
Document doc;
Element root;
NodeList nodes;
public String uri;
public AssetsLoaderListener l;
ArrayList<Contents> al;
public MyThread(String uri, AssetsLoaderListener l) {
this.uri = uri;
this.l = l;
}
private Contents modifyContents(NodeList contents) {
Contents ret = new Contents();
for(int i = 0; i < contents.getLength(); i++) {
Node result = contents.item(i);
if(result.getNodeType() == Node.ELEMENT_NODE) {
if(result.getNodeName().equals("Key")) {
ret.key = result.getTextContent();
}
if(result.getNodeName().equals("ETag")) {
ret.eTag = result.getTextContent();
}
if(result.getNodeName().equals("LastModified")) {
ret.lastModified = result.getTextContent();
}
if(result.getNodeName().equals("Size")) {
ret.size = result.getTextContent();
}
if(result.getNodeName().equals("StorageClass")) {
ret.storageClass = result.getTextContent();
}
}
}
return ret;
}
@Override
public void run() {
al = new ArrayList<Contents>();
try {
System.out.println("AssetsLoader - Download begin.");
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
DocumentBuilder db = factory.newDocumentBuilder();
doc = db.parse(uri);
System.out.println("AssetsLoader - Download end and format begin.");
root = doc.getDocumentElement();
nodes = root.getChildNodes();
for(int i = 0; i < nodes.getLength(); i++) {
Node result = nodes.item(i);
if(result.getNodeType() == Node.ELEMENT_NODE && result.getNodeName().equals("Contents")) {
al.add(modifyContents(result.getChildNodes()));
}
}
System.out.println("AssetsLoader - Format end.");
if(l != null)
l.OnDone(al);
} catch(Exception e) {
LogUtils.info("AssetsLoader - Failed");
if(l != null)
l.OnFailed(e);
}
}
}
public static void getAssets(String uri, AssetsLoaderListener l) {
MyThread thread = new MyThread(uri, l);
thread.start();
}
}
@@ -0,0 +1,18 @@
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package org.jackhuang.hellominecraftlauncher.plugin.settings.assets;
import java.util.ArrayList;
/**
*
* @author hyh
*/
public interface AssetsLoaderListener {
void OnDone(ArrayList<Contents> loader);
void OnFailed(Exception e);
}
@@ -0,0 +1,15 @@
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package org.jackhuang.hellominecraftlauncher.plugin.settings.assets;
/**
*
* @author hyh
*/
public class Contents {
public String key, eTag, lastModified, size, storageClass;
}
@@ -0,0 +1,23 @@
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package org.jackhuang.hellominecraftlauncher.plugin.settings.assets;
import com.google.gson.Gson;
/**
*
* @author hyh
*/
public class NewAssetsLoader {
private String indexesJson;
public NewAssetsLoader(String indexesJson) {
this.indexesJson = indexesJson;
}
public Objects format() {
return new Gson().fromJson(indexesJson, Objects.class);
}
}
@@ -0,0 +1,15 @@
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package org.jackhuang.hellominecraftlauncher.plugin.settings.assets;
import java.util.HashMap;
/**
*
* @author hyh
*/
public class Objects {
public HashMap<String, ObjectsItem> objects;
}
@@ -0,0 +1,14 @@
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package org.jackhuang.hellominecraftlauncher.plugin.settings.assets;
/**
*
* @author hyh
*/
public class ObjectsItem {
public String hash;
public int size;
}
@@ -0,0 +1,59 @@
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package org.jackhuang.hellominecraftlauncher.updater;
import org.jackhuang.hellominecraftlauncher.apis.DoneListener;
import org.jackhuang.hellominecraftlauncher.download.URLGet;
/**
*
* @author hyh
*/
public class CheckUpdate extends Thread {
DoneListener<UpdateRequest, Object> d;
public CheckUpdate(DoneListener<UpdateRequest, Object> d) {
this.d = d;
}
@Override
public void run() {
String data = URLGet.get("http://hellominecraftlauncher.duapp.com/update.php");
while((data.charAt(0) < '0' || data.charAt(0) > '9') && data.charAt(0) != '.')
data = data.substring(1);
String[] req = data.split(":");
UpdateRequest ur = null;
if(req.length == 2) {
String[] ver = req[0].split("\\.");
String un = req[1];
if(ver.length == 3) {
byte v1, v2, v3;
try {
v1 = Byte.parseByte(ver[0]);
v2 = Byte.parseByte(ver[1]);
v3 = Byte.parseByte(ver[2]);
ur = new UpdateRequest();
ur.firstVer = v1;
ur.secondVer = v2;
ur.thirdVer = v3;
ur.updateNote = un;
if(d != null)
{
d.onDone(ur, null);
return;
}
} catch(Exception e) {
e.printStackTrace();
}
}
}
d.onDone(ur, null);
}
public static void check(DoneListener<UpdateRequest, Object> d) {
new CheckUpdate(d).start();
}
}
@@ -0,0 +1,16 @@
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package org.jackhuang.hellominecraftlauncher.updater;
/**
*
* @author hyh
*/
public class UpdateRequest {
public byte firstVer, secondVer, thirdVer;
public String updateNote;
}
@@ -0,0 +1,35 @@
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package org.jackhuang.hellominecraftlauncher.utilities;
import java.util.ResourceBundle;
/**
*
* @author hyh
*/
public final class C {
public static final ResourceBundle I18N = ResourceBundle.getBundle("org/jackhuang/hellominecraftlauncher/I18N");
public static final String[] URL_LIBRARIES = new String[]{"https://libraries.minecraft.net/", "http://bmclapi.bangbang93.com/mclibraries/"};
public static final String[] URL_VERSIONS = new String[]{"https://s3.amazonaws.com/Minecraft.Download/versions/", "http://bmclapi.bangbang93.com/mcversion/"};
public static final String[] URL_INDEXES = new String[]{"https://s3.amazonaws.com/Minecraft.Download/indexes/", "http://bmclapi.bangbang93.com/mcindexes/"};
public static final String[] URL_VERSIONLIST = new String[]{"https://s3.amazonaws.com/Minecraft.Download/versions/versions.json", "http://bmclapi.bangbang93.com/mcversions/versions.json"};
public static final String[] URL_OPTIFINE = new String[]{"http://optifine.net/downloads.php", "http://bmclapi.bangbang93.com/optifine/versionlist"};
public static final String URL_FORGE_BMCL_LEGACY = "http://bmclapi.bangbang93.com/forge/legacylist";
public static final String URL_FORGE_BMCL_NEW = "http://bmclapi.bangbang93.com/forge/versionlist";
public static final String URL_INTEGRATE = "http://hmcl.googlecode.com/svn/trunk/integrate-packages/";
public static final String FILE_PLUGINS = "plugins";
public static final String URL_PUBLISH = "http://www.mcbbs.net/thread-142335-1-1.html";
public static final String URL_ASSETS_MOJANG = "http://resources.download.minecraft.net/";
public static final String URL_ASSETS_BMCL = "http://bmclapi.bangbang93.com/mcassets/";
public static final String URL_OLD_ASSETS_BMCL = "http://www.bangbang93.com/bmcl/resources/";
private C(){}
}
@@ -0,0 +1,47 @@
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package org.jackhuang.hellominecraftlauncher.utilities;
import java.io.File;
import org.jackhuang.hellominecraftlauncher.apis.utils.MessageBox;
import org.jackhuang.hellominecraftlauncher.apis.utils.Utils;
import org.jackhuang.hellominecraftlauncher.settings.Version;
/**
* 打开资源管理器
* @author jack
*/
public class FolderOpener {
public static void open(String s) {
try {
File f = new File(s);
f.mkdirs();
java.awt.Desktop.getDesktop().open(f);
} catch (Exception ex) {
MessageBox.Show("无法打开资源管理器: " + ex.getMessage());
}
}
public static void openResourcePacks(String gameDir) {
open(gameDir + "resourcepacks");
}
public static void openTextutrePacks(String gameDir) {
open(gameDir + "texturepacks");
}
public static void openMods(Version v) {
open(Utils.try2GetPath(v, "mods", SettingsManager.settings.publicSettings.gameDir));
}
public static void openCoreMods(Version v) {
open(Utils.try2GetPath(v, "coremods", SettingsManager.settings.publicSettings.gameDir));
}
public static void openModDir(Version v) {
open(Utils.try2GetPath(v, "moddir", SettingsManager.settings.publicSettings.gameDir));
}
public static void openConfig(Version v) {
open(Utils.try2GetPath(v, "config", SettingsManager.settings.publicSettings.gameDir));
}
}
@@ -0,0 +1,68 @@
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package org.jackhuang.hellominecraftlauncher.utilities;
import java.lang.reflect.Array;
import java.util.concurrent.locks.ReadWriteLock;
import java.util.concurrent.locks.ReentrantReadWriteLock;
/**
*
* @author hyh
*/
public class LimitedCapacityList<T>
{
private final T[] items;
private final Class<? extends T> clazz;
private final ReadWriteLock locks = new ReentrantReadWriteLock();
private int size;
private int head;
public LimitedCapacityList(Class<? extends T> clazz, int maxSize)
{
this.clazz = clazz;
this.items = (T[]) Array.newInstance(clazz, maxSize);
}
public T add(T value) {
this.locks.writeLock().lock();
this.items[this.head] = value;
this.head = ((this.head + 1) % getMaxSize());
if (this.size < getMaxSize()) this.size += 1;
this.locks.writeLock().unlock();
return value;
}
public int getSize() {
this.locks.readLock().lock();
int result = this.size;
this.locks.readLock().unlock();
return result;
}
public int getMaxSize() {
this.locks.readLock().lock();
int result = this.items.length;
this.locks.readLock().unlock();
return result;
}
public T[] getItems()
{
T[] result = (T[])Array.newInstance(this.clazz, this.size);
this.locks.readLock().lock();
for (int i = 0; i < this.size; i++) {
int pos = (this.head - this.size + i) % getMaxSize();
if (pos < 0) pos += getMaxSize();
result[i] = this.items[pos];
}
this.locks.readLock().unlock();
return result;
}
}
@@ -0,0 +1,139 @@
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package org.jackhuang.hellominecraftlauncher.utilities;
import org.jackhuang.hellominecraftlauncher.apis.utils.MessageBox;
import org.jackhuang.hellominecraftlauncher.apis.utils.Compressor;
import org.jackhuang.hellominecraftlauncher.apis.utils.Utils;
import com.google.gson.Gson;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import org.jackhuang.hellominecraftlauncher.apis.version.MinecraftLibrary;
import org.jackhuang.hellominecraftlauncher.apis.version.MinecraftVersion;
import org.jackhuang.hellominecraftlauncher.apis.version.Natives;
/**
*
* @author hyh
*/
public class MinecraftOldVersionIncluder {
Gson gson;
String path, name;
public MinecraftOldVersionIncluder(String path, String name)
{
this.path = path;
this.name = name;
this.gson = new Gson();
}
public void include()
{
String inc = Utils.addSeparator(SettingsManager.settings.publicSettings.gameDir);
String newname = name;
newname = newname.replace('.', File.separatorChar);
File file = new File(newname);
file.mkdirs();
String pa = Utils.addSeparator(path);
try
{
Utils.copyFile(pa + "bin" + File.separator + "minecraft.jar",
inc + "versions" + File.separator + name + File.separator + name + ".jar");
}
catch(IOException e)
{
e.printStackTrace();
MessageBox.Show("导入失败:" + e.getMessage());
return;
}
Compressor.zip(pa + "bin" + File.separator + "natives", inc + "libraries" + File.separator +
newname + File.separator + "natives" + File.separator + "HML" +
File.separator + "natives-HML-natives-" + Utils.os() + ".jar");
//forge mods
file = new File(pa + "mods");
if(file.exists())
try
{
Utils.copyDirectiory(file, new File(inc + "versions" + File.separator + name + File.separator + "mods"));
}
catch(IOException e)
{
e.printStackTrace();
MessageBox.Show("移动普通模组失败");
}
file = new File(pa + "coremods");
if(file.exists())
try
{
Utils.copyDirectiory(file, new File(inc + "versions" + File.separator + name + File.separator + "coremods"));
}
catch(IOException e)
{
e.printStackTrace();
MessageBox.Show("移动核心模组失败");
}
file = new File(pa + "config");
if(file.exists())
try
{
Utils.copyDirectiory(file, new File(inc + "versions" + File.separator + name + File.separator + "config"));
}
catch(IOException e)
{
e.printStackTrace();
MessageBox.Show("移动配置文件失败");
}
//create json
MinecraftVersion v = new MinecraftVersion();
v.id = name;
v.time = "";
v.releaseTime = "";
v.minecraftArguments = "${auth_player_name} ${auth_session} --workDir ${game_directory}";
v.minimumLauncherVersion = 0;
v.mainClass = "net.minecraft.client.Minecraft";
ArrayList<String> s = Utils.findAllFile(new File(pa + "bin"));
ArrayList<MinecraftLibrary> libs = new ArrayList<MinecraftLibrary>();
MinecraftLibrary lib;
for(int i = 0; i < s.size(); i++)
{
String f = Utils.extractFileName(s.get(i));
String na = f.substring(0, f.length() - 4);
if(f != "minecraft.jar")
{
file = new File(inc + "libraries" + File.separator + newname + File.separator + na + File.separator + "HML");
file.mkdirs();
try
{
Utils.copyFile(pa + "bin" + File.separator + s.get(i), inc + "libraries" + File.separator + newname + File.separator + na + File.separator + "HML" + File.separator + na + "-HML.jar");
}
catch(IOException e)
{
e.printStackTrace();
MessageBox.Show("复制文件失败:" + s.get(i));
}
lib = new MinecraftLibrary();
lib.name = name + ':' + na + ":HML";
libs.add(lib);
}
}
lib = new MinecraftLibrary();
lib.name = name + ":natives:HML";
Natives n = new Natives();
n.windows = "natives-windows";
n.linux = "natives-linux";
n.osx = "natives-osx";
lib.natives = n;
libs.add(lib);
v.libraries = libs;
String c = gson.toJson(v);
Utils.writeToFile(new File(inc + "versions" + File.separator + name + File.separator + name + ".json"), c);
}
}
@@ -0,0 +1,57 @@
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package org.jackhuang.hellominecraftlauncher.utilities;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import org.jackhuang.hellominecraftlauncher.JavaProcess;
/**
*
* @author hyh
*/
public class ProcessThread extends Thread {
JavaProcess p;
ProcessListener l;
public interface ProcessListener {
void onPrintln(String line);
void onStop();
}
public ProcessThread(JavaProcess process, ProcessListener listener) {
p = process;
l = listener;
}
public JavaProcess getProcess() {
return p;
}
@Override
public void run() {
try {
BufferedReader bufferedReader =
new BufferedReader(new InputStreamReader(p.getRawProcess().getInputStream()));
String line;
while (p.isRunning()) {
if((line = bufferedReader.readLine()) == null)
break;
if (l != null) l.onPrintln(line);
System.out.println(line);
p.getSysOutLines().add(line);
}
if (l != null) {
l.onStop();
}
} catch (Exception e) {
e.printStackTrace();
} finally {
}
}
}
@@ -0,0 +1,96 @@
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package org.jackhuang.hellominecraftlauncher.utilities;
import com.google.gson.Gson;
import java.io.File;
import java.util.ArrayList;
import org.jackhuang.hellominecraftlauncher.apis.utils.Utils;
import org.jackhuang.hellominecraftlauncher.settings.Settings;
import org.jackhuang.hellominecraftlauncher.settings.Version;
/**
*
* @author hyh
*/
public class SettingsManager {
public static Settings settings;
static Gson gson;
public static void load() {
gson = new Gson();
File file = new File(Utils.addSeparator(Utils.currentDir()) + "settings.json");
if(file.exists())
{
String str = Utils.readToEnd(file);
if(str == null || str.trim().equals(""))
{
init();
}
else
{
settings = gson.fromJson(str, Settings.class);
}
}
else
{
settings = new Settings();
save();
}
}
public static void init()
{
settings = new Settings();
save();
}
public static void save()
{
Utils.writeToFile(new File(Utils.addSeparator(Utils.currentDir()) + "settings.json"), gson.toJson(settings));
}
public static Version getVersion(String name)
{
if(settings == null) return null;
if(settings.versions == null) return null;
for(int i = 0; i < settings.versions.size(); i++)
{
Version v = settings.versions.get(i);
if(v == null) continue;
if(v.name == null) continue;
if(v.name.equals(name))
return v;
}
return null;
}
public static void setVersion(Version ver)
{
if(ver == null) return;
if(settings.versions == null)
{
settings.versions = new ArrayList<Version>();
}
for(int i = 0; i < settings.versions.size(); i++)
{
Version v = settings.versions.get(i);
if(v == null) continue;
if(v.name == null || v.name.equals(ver.name))
{
settings.versions.set(i, ver);
return;
}
}
settings.versions.add(ver);
}
public static void delVersion(Version ver) {
if(settings == null || settings.versions == null)
return;
settings.versions.remove(ver);
}
}
@@ -0,0 +1,98 @@
<?xml version="1.0" encoding="UTF-8" ?>
<Form version="1.3" maxVersion="1.8" type="org.netbeans.modules.form.forminfo.JFrameFormInfo">
<Properties>
<Property name="defaultCloseOperation" type="int" value="2"/>
<Property name="title" type="java.lang.String" value="Log"/>
</Properties>
<SyntheticProperties>
<SyntheticProperty name="formSizePolicy" type="int" value="1"/>
<SyntheticProperty name="generateCenter" type="boolean" value="false"/>
</SyntheticProperties>
<Events>
<EventHandler event="windowClosed" listener="java.awt.event.WindowListener" parameters="java.awt.event.WindowEvent" handler="formWindowClosed"/>
</Events>
<AuxValues>
<AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="0"/>
<AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/>
<AuxValue name="FormSettings_generateFQN" type="java.lang.Boolean" value="true"/>
<AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="false"/>
<AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="false"/>
<AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="1"/>
<AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/>
<AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/>
<AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/>
</AuxValues>
<Layout>
<DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Component id="jScrollPane1" pref="351" max="32767" attributes="0"/>
<Group type="102" alignment="1" attributes="0">
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
<Component id="btnClear" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="btnClose" min="-2" max="-2" attributes="0"/>
</Group>
</Group>
<EmptySpace max="-2" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
<DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Component id="jScrollPane1" pref="235" max="32767" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="btnClear" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="btnClose" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace max="-2" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
</Layout>
<SubComponents>
<Container class="javax.swing.JScrollPane" name="jScrollPane1">
<AuxValues>
<AuxValue name="autoScrollPane" type="java.lang.Boolean" value="true"/>
</AuxValues>
<Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/>
<SubComponents>
<Component class="javax.swing.JTextArea" name="txtLog">
<Properties>
<Property name="editable" type="boolean" value="false"/>
<Property name="columns" type="int" value="20"/>
<Property name="rows" type="int" value="5"/>
</Properties>
</Component>
</SubComponents>
</Container>
<Component class="javax.swing.JButton" name="btnClear">
<Properties>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="org/jackhuang/hellominecraftlauncher/I18N.properties" key="Clear" replaceFormat="java.util.ResourceBundle.getBundle(&quot;{bundleNameSlashes}&quot;).getString(&quot;{key}&quot;)"/>
</Property>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnClearActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JButton" name="btnClose">
<Properties>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="org/jackhuang/hellominecraftlauncher/I18N.properties" key="Close" replaceFormat="java.util.ResourceBundle.getBundle(&quot;{bundleNameSlashes}&quot;).getString(&quot;{key}&quot;)"/>
</Property>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnCloseActionPerformed"/>
</Events>
</Component>
</SubComponents>
</Form>
@@ -0,0 +1,141 @@
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package org.jackhuang.hellominecraftlauncher.views;
import java.awt.Dimension;
import java.awt.Frame;
import java.awt.Toolkit;
/**
*
* @author hyh
*/
public class LogWindow extends javax.swing.JFrame {
/**
* Creates new form LogWindow
*/
public LogWindow() {
initComponents();
Dimension scrSize = Toolkit.getDefaultToolkit().getScreenSize();
setLocation((scrSize.width - this.getWidth()) / 2,
(scrSize.height - this.getHeight()) / 2);
}
public static LogWindow instance;
static {
instance = new LogWindow();
}
/**
* This method is called from within the constructor to initialize the form.
* WARNING: Do NOT modify this code. The content of this method is always
* regenerated by the Form Editor.
*/
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
jScrollPane1 = new javax.swing.JScrollPane();
txtLog = new javax.swing.JTextArea();
btnClear = new javax.swing.JButton();
btnClose = new javax.swing.JButton();
setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
setTitle("Log");
addWindowListener(new java.awt.event.WindowAdapter() {
public void windowClosed(java.awt.event.WindowEvent evt) {
formWindowClosed(evt);
}
});
txtLog.setEditable(false);
txtLog.setColumns(20);
txtLog.setRows(5);
jScrollPane1.setViewportView(txtLog);
java.util.ResourceBundle bundle = java.util.ResourceBundle.getBundle("org/jackhuang/hellominecraftlauncher/I18N"); // NOI18N
btnClear.setText(bundle.getString("Clear")); // NOI18N
btnClear.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnClearActionPerformed(evt);
}
});
btnClose.setText(bundle.getString("Close")); // NOI18N
btnClose.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnCloseActionPerformed(evt);
}
});
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 351, Short.MAX_VALUE)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
.addGap(0, 0, Short.MAX_VALUE)
.addComponent(btnClear)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(btnClose)))
.addContainerGap())
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 235, Short.MAX_VALUE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(btnClear)
.addComponent(btnClose))
.addContainerGap())
);
pack();
}// </editor-fold>//GEN-END:initComponents
private void btnCloseActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnCloseActionPerformed
this.dispose();
}//GEN-LAST:event_btnCloseActionPerformed
private void btnClearActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnClearActionPerformed
this.txtLog.setText("");
}//GEN-LAST:event_btnClearActionPerformed
private void formWindowClosed(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_formWindowClosed
boolean dispose = true;
for (Frame f : Frame.getFrames()) {
if(f.getTitle().startsWith("Hello") && f.isVisible())
dispose = false;
}
if(dispose) System.exit(0);
}//GEN-LAST:event_formWindowClosed
public void log(String status) {
String text = txtLog.getText();
text += status + System.getProperty("line.separator");
int position = text.length();
txtLog.setText(text);
txtLog.setCaretPosition(position);
}
public void clean() {
txtLog.setText("");
}
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JButton btnClear;
private javax.swing.JButton btnClose;
private javax.swing.JScrollPane jScrollPane1;
private javax.swing.JTextArea txtLog;
// End of variables declaration//GEN-END:variables
}
@@ -0,0 +1,463 @@
<?xml version="1.0" encoding="UTF-8" ?>
<Form version="1.5" maxVersion="1.8" type="org.netbeans.modules.form.forminfo.JFrameFormInfo">
<Properties>
<Property name="defaultCloseOperation" type="int" value="3"/>
<Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor">
<Color blue="ff" green="99" red="99" type="rgb"/>
</Property>
<Property name="resizable" type="boolean" value="false"/>
</Properties>
<SyntheticProperties>
<SyntheticProperty name="formSizePolicy" type="int" value="1"/>
<SyntheticProperty name="generateCenter" type="boolean" value="false"/>
</SyntheticProperties>
<Events>
<EventHandler event="windowClosing" listener="java.awt.event.WindowListener" parameters="java.awt.event.WindowEvent" handler="formWindowClosing"/>
</Events>
<AuxValues>
<AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="0"/>
<AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/>
<AuxValue name="FormSettings_generateFQN" type="java.lang.Boolean" value="true"/>
<AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="false"/>
<AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="false"/>
<AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="1"/>
<AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/>
<AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/>
<AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/>
<AuxValue name="designerSize" type="java.awt.Dimension" value="-84,-19,0,5,115,114,0,18,106,97,118,97,46,97,119,116,46,68,105,109,101,110,115,105,111,110,65,-114,-39,-41,-84,95,68,20,2,0,2,73,0,6,104,101,105,103,104,116,73,0,5,119,105,100,116,104,120,112,0,0,1,17,0,0,1,-108"/>
</AuxValues>
<Layout class="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout">
<Property name="useNullLayout" type="boolean" value="true"/>
</Layout>
<SubComponents>
<Container class="javax.swing.JPanel" name="pnlMore">
<Properties>
<Property name="opaque" type="boolean" value="false"/>
</Properties>
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription">
<AbsoluteConstraints x="-190" y="0" width="250" height="290"/>
</Constraint>
</Constraints>
<Layout class="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout">
<Property name="useNullLayout" type="boolean" value="true"/>
</Layout>
<SubComponents>
<Component class="javax.swing.JButton" name="btnShowMore">
<Properties>
<Property name="text" type="java.lang.String" value="&#x66f4;&#x591a;"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnShowMoreActionPerformed"/>
</Events>
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription">
<AbsoluteConstraints x="190" y="0" width="60" height="20"/>
</Constraint>
</Constraints>
</Component>
<Container class="javax.swing.JPanel" name="pnlMoreIn">
<Properties>
<Property name="opaque" type="boolean" value="false"/>
</Properties>
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription">
<AbsoluteConstraints x="0" y="0" width="190" height="280"/>
</Constraint>
</Constraints>
<Layout class="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout">
<Property name="useNullLayout" type="boolean" value="true"/>
</Layout>
<SubComponents>
<Container class="javax.swing.JPanel" name="jPanel1">
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription">
<AbsoluteConstraints x="10" y="10" width="170" height="150"/>
</Constraint>
</Constraints>
<Layout>
<DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" attributes="0">
<EmptySpace min="-2" pref="0" max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Component id="cboMinecrafts" alignment="0" max="32767" attributes="0"/>
<Group type="102" alignment="0" attributes="0">
<Component id="btnRefresh" min="-2" max="-2" attributes="0"/>
<EmptySpace pref="56" max="32767" attributes="0"/>
<Component id="btnShowManageMenu" min="-2" max="-2" attributes="0"/>
</Group>
<Group type="102" alignment="0" attributes="0">
<Component id="btnShowIncludeMenu" min="-2" max="-2" attributes="0"/>
<EmptySpace max="32767" attributes="0"/>
<Component id="btnManage" min="-2" max="-2" attributes="0"/>
</Group>
<Group type="102" attributes="0">
<Component id="jLabel10" min="-2" max="-2" attributes="0"/>
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
</Group>
<Component id="btnVersionEdit" max="32767" attributes="0"/>
</Group>
<EmptySpace min="-2" pref="0" max="-2" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
<DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Component id="jLabel10" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="cboMinecrafts" min="-2" pref="26" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="btnRefresh" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="btnShowManageMenu" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace min="6" pref="6" max="-2" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="btnShowIncludeMenu" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="btnManage" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace max="-2" attributes="0"/>
<Component id="btnVersionEdit" min="-2" max="-2" attributes="0"/>
<EmptySpace max="32767" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
</Layout>
<SubComponents>
<Component class="javax.swing.JLabel" name="jLabel10">
<Properties>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="org/jackhuang/hellominecraftlauncher/I18N.properties" key="&#x6e38;&#x620f;&#x7248;&#x672c;" replaceFormat="java.util.ResourceBundle.getBundle(&quot;{bundleNameSlashes}&quot;).getString(&quot;{key}&quot;)"/>
</Property>
</Properties>
</Component>
<Component class="javax.swing.JComboBox" name="cboMinecrafts">
<Properties>
<Property name="model" type="javax.swing.ComboBoxModel" editor="org.netbeans.modules.form.editors2.ComboBoxModelEditor">
<StringArray count="0"/>
</Property>
</Properties>
<Events>
<EventHandler event="itemStateChanged" listener="java.awt.event.ItemListener" parameters="java.awt.event.ItemEvent" handler="cboMinecraftsItemStateChanged"/>
</Events>
</Component>
<Component class="javax.swing.JButton" name="btnRefresh">
<Properties>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="org/jackhuang/hellominecraftlauncher/I18N.properties" key="&#x5237;&#x65b0;" replaceFormat="java.util.ResourceBundle.getBundle(&quot;{bundleNameSlashes}&quot;).getString(&quot;{key}&quot;)"/>
</Property>
<Property name="toolTipText" type="java.lang.String" value="&#x5237;&#x65b0;&#x5217;&#x8868;"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnRefreshActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JButton" name="btnShowManageMenu">
<Properties>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="org/jackhuang/hellominecraftlauncher/I18N.properties" key="&#x64cd;&#x4f5c;" replaceFormat="java.util.ResourceBundle.getBundle(&quot;{bundleNameSlashes}&quot;).getString(&quot;{key}&quot;)"/>
</Property>
<Property name="toolTipText" type="java.lang.String" value="&#x4e00;&#x4e9b;&#x5bf9;&#x7248;&#x672c;&#x7684;&#x64cd;&#x4f5c;"/>
</Properties>
<Events>
<EventHandler event="mouseClicked" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="btnShowManageMenuMouseClicked"/>
</Events>
</Component>
<Component class="javax.swing.JButton" name="btnManage">
<Properties>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="org/jackhuang/hellominecraftlauncher/I18N.properties" key="&#x7ba1;&#x7406;" replaceFormat="java.util.ResourceBundle.getBundle(&quot;{bundleNameSlashes}&quot;).getString(&quot;{key}&quot;)"/>
</Property>
<Property name="toolTipText" type="java.lang.String" value="&#x5bf9;MC&#x7248;&#x672c;&#x7684;&#x6a21;&#x7ec4;&#x7ba1;&#x7406;"/>
</Properties>
<Events>
<EventHandler event="mouseClicked" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="btnManageMouseClicked"/>
</Events>
</Component>
<Component class="javax.swing.JButton" name="btnShowIncludeMenu">
<Properties>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="org/jackhuang/hellominecraftlauncher/I18N.properties" key="&#x5bfc;&#x5165;" replaceFormat="java.util.ResourceBundle.getBundle(&quot;{bundleNameSlashes}&quot;).getString(&quot;{key}&quot;)"/>
</Property>
<Property name="toolTipText" type="java.lang.String" value="&#x5bfc;&#x5165;&#x4e0d;&#x5728;&#x5168;&#x5c40;&#x8bbe;&#x7f6e;&#x4e2d;&#x6e38;&#x620f;&#x8def;&#x5f84;&#x7684;Minecraft"/>
</Properties>
<Events>
<EventHandler event="mouseClicked" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="btnShowIncludeMenuMouseClicked"/>
</Events>
</Component>
<Component class="javax.swing.JButton" name="btnVersionEdit">
<Properties>
<Property name="text" type="java.lang.String" value="&#x7248;&#x672c;&#x7ba1;&#x7406;"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnVersionEditActionPerformed"/>
</Events>
</Component>
</SubComponents>
</Container>
<Container class="javax.swing.JPanel" name="jPanel2">
<Properties>
<Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor">
<Color blue="cc" green="cc" red="cc" type="rgb"/>
</Property>
<Property name="opaque" type="boolean" value="false"/>
</Properties>
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription">
<AbsoluteConstraints x="10" y="170" width="170" height="-1"/>
</Constraint>
</Constraints>
<Layout>
<DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<EmptySpace min="-2" pref="2" max="-2" attributes="0"/>
<Group type="103" groupAlignment="1" attributes="0">
<Component id="pnlPassword" alignment="1" max="32767" attributes="0"/>
<Group type="102" alignment="0" attributes="0">
<Component id="jLabel7" min="-2" max="-2" attributes="0"/>
<EmptySpace max="32767" attributes="0"/>
<Component id="cboLoginMode" min="-2" max="-2" attributes="0"/>
</Group>
<Group type="102" alignment="0" attributes="0">
<Component id="jLabel8" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="txtPlayerName" max="32767" attributes="0"/>
</Group>
</Group>
<EmptySpace min="-2" pref="0" max="-2" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
<DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="jLabel7" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="cboLoginMode" alignment="3" min="-2" pref="26" max="-2" attributes="0"/>
</Group>
<EmptySpace min="-2" pref="6" max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<EmptySpace min="3" pref="3" max="-2" attributes="0"/>
<Component id="jLabel8" min="-2" max="-2" attributes="0"/>
</Group>
<Component id="txtPlayerName" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace max="-2" attributes="0"/>
<Component id="pnlPassword" min="-2" max="-2" attributes="0"/>
<EmptySpace max="32767" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
</Layout>
<SubComponents>
<Component class="javax.swing.JTextField" name="txtPlayerName">
<Events>
<EventHandler event="focusLost" listener="java.awt.event.FocusListener" parameters="java.awt.event.FocusEvent" handler="txtPlayerNameFocusLost"/>
<EventHandler event="keyPressed" listener="java.awt.event.KeyListener" parameters="java.awt.event.KeyEvent" handler="txtPlayerNameKeyPressed"/>
</Events>
</Component>
<Component class="javax.swing.JLabel" name="jLabel7">
<Properties>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="org/jackhuang/hellominecraftlauncher/I18N.properties" key="&#x767b;&#x5f55;&#x6a21;&#x5f0f;" replaceFormat="java.util.ResourceBundle.getBundle(&quot;{bundleNameSlashes}&quot;).getString(&quot;{key}&quot;)"/>
</Property>
</Properties>
</Component>
<Component class="javax.swing.JComboBox" name="cboLoginMode">
<Properties>
<Property name="model" type="javax.swing.ComboBoxModel" editor="org.netbeans.modules.form.editors2.ComboBoxModelEditor">
<StringArray count="0"/>
</Property>
</Properties>
<Events>
<EventHandler event="itemStateChanged" listener="java.awt.event.ItemListener" parameters="java.awt.event.ItemEvent" handler="cboLoginModeItemStateChanged"/>
</Events>
</Component>
<Component class="javax.swing.JLabel" name="jLabel8">
<Properties>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="org/jackhuang/hellominecraftlauncher/I18N.properties" key="&#x6e38;&#x620f;&#x540d;&#x79f0;" replaceFormat="java.util.ResourceBundle.getBundle(&quot;{bundleNameSlashes}&quot;).getString(&quot;{key}&quot;)"/>
</Property>
</Properties>
</Component>
<Container class="javax.swing.JPanel" name="pnlPassword">
<Layout class="org.netbeans.modules.form.compat2.layouts.DesignCardLayout"/>
<SubComponents>
<Container class="javax.swing.JPanel" name="jPanel3">
<Properties>
<Property name="minimumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[0, 0]"/>
</Property>
</Properties>
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignCardLayout" value="org.netbeans.modules.form.compat2.layouts.DesignCardLayout$CardConstraintsDescription">
<CardConstraints cardName="card2"/>
</Constraint>
</Constraints>
<Layout>
<DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<Component id="lblPassword" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="txtPassword" pref="140" max="32767" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
<DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<Group type="103" groupAlignment="3" attributes="0">
<Component id="lblPassword" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="txtPassword" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace min="0" pref="2" max="32767" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
</Layout>
<SubComponents>
<Component class="javax.swing.JPasswordField" name="txtPassword">
</Component>
<Component class="javax.swing.JLabel" name="lblPassword">
<Properties>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="org/jackhuang/hellominecraftlauncher/I18N.properties" key="&#x5bc6;&#x7801;" replaceFormat="java.util.ResourceBundle.getBundle(&quot;{bundleNameSlashes}&quot;).getString(&quot;{key}&quot;)"/>
</Property>
</Properties>
</Component>
</SubComponents>
</Container>
<Container class="javax.swing.JPanel" name="jPanel20">
<Properties>
<Property name="minimumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[0, 0]"/>
</Property>
</Properties>
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignCardLayout" value="org.netbeans.modules.form.compat2.layouts.DesignCardLayout$CardConstraintsDescription">
<CardConstraints cardName="card3"/>
</Constraint>
</Constraints>
<Layout>
<DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0">
<Component id="btnLogOut" alignment="0" pref="168" max="32767" attributes="0"/>
</Group>
</DimensionLayout>
<DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="1" attributes="0">
<Component id="btnLogOut" min="-2" max="-2" attributes="0"/>
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
</Layout>
<SubComponents>
<Component class="javax.swing.JButton" name="btnLogOut">
<Properties>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="org/jackhuang/hellominecraftlauncher/I18N.properties" key="Logout" replaceFormat="java.util.ResourceBundle.getBundle(&quot;{bundleNameSlashes}&quot;).getString(&quot;{key}&quot;)"/>
</Property>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnLogOutActionPerformed"/>
</Events>
</Component>
</SubComponents>
</Container>
</SubComponents>
</Container>
</SubComponents>
</Container>
</SubComponents>
</Container>
</SubComponents>
</Container>
<Container class="javax.swing.JPanel" name="jPanel4">
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription">
<AbsoluteConstraints x="130" y="210" width="270" height="60"/>
</Constraint>
</Constraints>
<Layout>
<DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="1" attributes="0">
<EmptySpace min="0" pref="4" max="32767" attributes="0"/>
<Component id="btnRun" min="-2" pref="140" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="1" attributes="0">
<Component id="btnMakeLauncher" min="-2" pref="120" max="-2" attributes="0"/>
<Component id="txtShowOptions" min="-2" pref="120" max="-2" attributes="0"/>
</Group>
<EmptySpace min="-2" pref="0" max="-2" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
<DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<Group type="103" groupAlignment="1" max="-2" attributes="0">
<Component id="btnRun" alignment="0" max="32767" attributes="0"/>
<Group type="102" attributes="0">
<Component id="txtShowOptions" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="btnMakeLauncher" min="-2" pref="24" max="-2" attributes="0"/>
</Group>
</Group>
<EmptySpace max="32767" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
</Layout>
<SubComponents>
<Component class="javax.swing.JButton" name="btnMakeLauncher">
<Properties>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="org/jackhuang/hellominecraftlauncher/I18N.properties" key="&#x5236;&#x4f5c;&#x4e00;&#x952e;&#x542f;&#x52a8;" replaceFormat="java.util.ResourceBundle.getBundle(&quot;{bundleNameSlashes}&quot;).getString(&quot;{key}&quot;)"/>
</Property>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnMakeLauncherActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JButton" name="txtShowOptions">
<Properties>
<Property name="text" type="java.lang.String" value="&#x8bbe;&#x7f6e;"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="txtShowOptionsActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JButton" name="btnRun">
<Properties>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="org/jackhuang/hellominecraftlauncher/I18N.properties" key="&#x5f00;&#x59cb;MINECRAFT&#x4e4b;&#x65c5;!" replaceFormat="java.util.ResourceBundle.getBundle(&quot;{bundleNameSlashes}&quot;).getString(&quot;{key}&quot;)"/>
</Property>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnRunActionPerformed"/>
</Events>
</Component>
</SubComponents>
</Container>
</SubComponents>
</Form>
File diff suppressed because it is too large. Load diff
@@ -0,0 +1,283 @@
<?xml version="1.0" encoding="UTF-8" ?>
<Form version="1.5" maxVersion="1.8" type="org.netbeans.modules.form.forminfo.JDialogFormInfo">
<NonVisualComponents>
<Container class="javax.swing.JInternalFrame" name="jInternalFrame1">
<Properties>
<Property name="visible" type="boolean" value="true"/>
</Properties>
<Layout>
<DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0">
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
</Group>
</DimensionLayout>
<DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0">
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
</Group>
</DimensionLayout>
</Layout>
</Container>
</NonVisualComponents>
<Properties>
<Property name="defaultCloseOperation" type="int" value="2"/>
</Properties>
<AccessibilityProperties>
<Property name="AccessibleContext.accessibleDescription" type="java.lang.String" value=""/>
</AccessibilityProperties>
<SyntheticProperties>
<SyntheticProperty name="formSizePolicy" type="int" value="1"/>
<SyntheticProperty name="generateCenter" type="boolean" value="false"/>
</SyntheticProperties>
<Events>
<EventHandler event="windowClosed" listener="java.awt.event.WindowListener" parameters="java.awt.event.WindowEvent" handler="formWindowClosed"/>
</Events>
<AuxValues>
<AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="0"/>
<AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/>
<AuxValue name="FormSettings_generateFQN" type="java.lang.Boolean" value="true"/>
<AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="false"/>
<AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="false"/>
<AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="1"/>
<AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/>
<AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/>
<AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/>
</AuxValues>
<Layout>
<DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" attributes="0">
<Group type="103" groupAlignment="0" attributes="0">
<Component id="jSeparator1" alignment="0" max="32767" attributes="0"/>
<Group type="102" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<Component id="jLabel4" min="-2" max="-2" attributes="0"/>
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
</Group>
<Component id="jTabbedPane1" alignment="0" max="32767" attributes="0"/>
<Group type="102" alignment="1" attributes="0">
<Component id="jLabel13" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="txtMinecraftVersion" max="32767" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="btnCancel" min="-2" max="-2" attributes="0"/>
</Group>
<Group type="102" attributes="0">
<Component id="jLabel1" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="txtName" max="32767" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="btnOK" min="-2" max="-2" attributes="0"/>
</Group>
</Group>
</Group>
</Group>
<EmptySpace max="-2" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
<DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="jLabel1" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="txtName" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="btnOK" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="jLabel13" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="txtMinecraftVersion" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="btnCancel" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace min="-2" pref="4" max="-2" attributes="0"/>
<Component id="jSeparator1" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="jLabel4" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="jTabbedPane1" max="32767" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
</Layout>
<SubComponents>
<Component class="javax.swing.JLabel" name="jLabel1">
<Properties>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="org/jackhuang/hellominecraftlauncher/I18N.properties" key="&#x540d;&#x79f0;" replaceFormat="java.util.ResourceBundle.getBundle(&quot;{bundleNameSlashes}&quot;).getString(&quot;{key}&quot;)"/>
</Property>
<Property name="toolTipText" type="java.lang.String" value=""/>
</Properties>
</Component>
<Component class="javax.swing.JTextField" name="txtName">
</Component>
<Component class="javax.swing.JSeparator" name="jSeparator1">
</Component>
<Component class="javax.swing.JButton" name="btnOK">
<Properties>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="org/jackhuang/hellominecraftlauncher/I18N.properties" key="&#x786e;&#x5b9a;" replaceFormat="java.util.ResourceBundle.getBundle(&quot;{bundleNameSlashes}&quot;).getString(&quot;{key}&quot;)"/>
</Property>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnOKActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JButton" name="btnCancel">
<Properties>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="org/jackhuang/hellominecraftlauncher/I18N.properties" key="&#x53d6;&#x6d88;" replaceFormat="java.util.ResourceBundle.getBundle(&quot;{bundleNameSlashes}&quot;).getString(&quot;{key}&quot;)"/>
</Property>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnCancelActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JLabel" name="jLabel4">
<Properties>
<Property name="foreground" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor">
<Color blue="0" green="0" red="ff" type="rgb"/>
</Property>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="org/jackhuang/hellominecraftlauncher/I18N.properties" key="&#x4ee5;&#x4e0b;&#x8bbe;&#x7f6e;&#x5b57;&#x6bb5;&#x4e3a;&#x7a7a;&#x4ee3;&#x8868;&#x7740;&#x4f7f;&#x7528;&#x9ed8;&#x8ba4;&#x8bbe;&#x7f6e;" replaceFormat="java.util.ResourceBundle.getBundle(&quot;{bundleNameSlashes}&quot;).getString(&quot;{key}&quot;)"/>
</Property>
</Properties>
</Component>
<Container class="javax.swing.JTabbedPane" name="jTabbedPane1">
<AccessibilityProperties>
<Property name="AccessibleContext.accessibleName" type="java.lang.String" value=""/>
</AccessibilityProperties>
<Layout class="org.netbeans.modules.form.compat2.layouts.support.JTabbedPaneSupportLayout"/>
<SubComponents>
<Container class="javax.swing.JPanel" name="jPanel1">
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.support.JTabbedPaneSupportLayout" value="org.netbeans.modules.form.compat2.layouts.support.JTabbedPaneSupportLayout$JTabbedPaneConstraintsDescription">
<JTabbedPaneConstraints tabName="&#x666e;&#x901a;&#x8bbe;&#x7f6e;">
<Property name="tabTitle" type="java.lang.String" value="&#x666e;&#x901a;&#x8bbe;&#x7f6e;"/>
</JTabbedPaneConstraints>
</Constraint>
</Constraints>
<Layout>
<DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Component id="txtGameDir" alignment="0" max="32767" attributes="0"/>
<Component id="txtJavaDir" alignment="0" max="32767" attributes="0"/>
<Component id="txtMaxMemory" alignment="0" max="32767" attributes="0"/>
<Component id="txtJavaArgs" alignment="0" max="32767" attributes="0"/>
<Group type="102" attributes="0">
<Component id="jLabel7" min="-2" max="-2" attributes="0"/>
<EmptySpace pref="399" max="32767" attributes="0"/>
<Component id="chkOver16" min="-2" max="-2" attributes="0"/>
</Group>
<Group type="102" attributes="0">
<Group type="103" groupAlignment="0" attributes="0">
<Component id="jLabel11" alignment="0" min="-2" max="-2" attributes="0"/>
<Component id="jLabel6" alignment="0" min="-2" max="-2" attributes="0"/>
<Component id="jLabel10" alignment="0" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
</Group>
</Group>
<EmptySpace max="-2" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
<DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="jLabel7" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="chkOver16" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace max="-2" attributes="0"/>
<Component id="txtGameDir" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="jLabel11" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="txtJavaDir" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="jLabel6" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="txtJavaArgs" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="jLabel10" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="txtMaxMemory" min="-2" max="-2" attributes="0"/>
<EmptySpace pref="178" max="32767" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
</Layout>
<SubComponents>
<Component class="javax.swing.JLabel" name="jLabel7">
<Properties>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="org/jackhuang/hellominecraftlauncher/I18N.properties" key="&#x6e38;&#x620f;&#x8def;&#x5f84;" replaceFormat="java.util.ResourceBundle.getBundle(&quot;{bundleNameSlashes}&quot;).getString(&quot;{key}&quot;)"/>
</Property>
</Properties>
</Component>
<Component class="javax.swing.JTextField" name="txtGameDir">
</Component>
<Component class="javax.swing.JTextField" name="txtJavaDir">
</Component>
<Component class="javax.swing.JLabel" name="jLabel11">
<Properties>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="org/jackhuang/hellominecraftlauncher/I18N.properties" key="JAVA&#x8def;&#x5f84;" replaceFormat="java.util.ResourceBundle.getBundle(&quot;{bundleNameSlashes}&quot;).getString(&quot;{key}&quot;)"/>
</Property>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="jLabel6">
<Properties>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="org/jackhuang/hellominecraftlauncher/I18N.properties" key="JAVA&#x865a;&#x62df;&#x673a;&#x53c2;&#x6570;" replaceFormat="java.util.ResourceBundle.getBundle(&quot;{bundleNameSlashes}&quot;).getString(&quot;{key}&quot;)"/>
</Property>
</Properties>
</Component>
<Component class="javax.swing.JTextField" name="txtJavaArgs">
</Component>
<Component class="javax.swing.JLabel" name="jLabel10">
<Properties>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="org/jackhuang/hellominecraftlauncher/I18N.properties" key="&#x6700;&#x5927;&#x5185;&#x5b58;" replaceFormat="java.util.ResourceBundle.getBundle(&quot;{bundleNameSlashes}&quot;).getString(&quot;{key}&quot;)"/>
</Property>
</Properties>
</Component>
<Component class="javax.swing.JTextField" name="txtMaxMemory">
</Component>
<Component class="javax.swing.JCheckBox" name="chkOver16">
<Properties>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="org/jackhuang/hellominecraftlauncher/I18N.properties" key="1.6&#x53ca;&#x4ee5;&#x4e0a;&#x7248;&#x672c;&#x4ee5;&#x53ca;&#x5bfc;&#x5165;&#x7684;&#x65e7;&#x7248;&#x672c;" replaceFormat="java.util.ResourceBundle.getBundle(&quot;{bundleNameSlashes}&quot;).getString(&quot;{key}&quot;)"/>
</Property>
</Properties>
</Component>
</SubComponents>
</Container>
</SubComponents>
</Container>
<Component class="javax.swing.JLabel" name="jLabel13">
<Properties>
<Property name="text" type="java.lang.String" value="Minecraft &#x7248;&#x672c;"/>
</Properties>
</Component>
<Component class="javax.swing.JTextField" name="txtMinecraftVersion">
<Properties>
<Property name="editable" type="boolean" value="false"/>
</Properties>
</Component>
</SubComponents>
</Form>
@@ -0,0 +1,366 @@
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package org.jackhuang.hellominecraftlauncher.views;
import java.awt.Dimension;
import java.awt.Toolkit;
import java.io.File;
import java.util.ArrayList;
import org.jackhuang.hellominecraftlauncher.apis.utils.MessageBox;
import org.jackhuang.hellominecraftlauncher.utilities.SettingsManager;
import org.jackhuang.hellominecraftlauncher.apis.utils.Utils;
import org.jackhuang.hellominecraftlauncher.settings.Version;
import org.jackhuang.hellominecraftlauncher.utilities.C;
import org.jackhuang.hellominecraftlauncher.apis.utils.MinecraftVersionRequest;
/**
*
* @author hyh
*/
public class NewVersionWindow extends javax.swing.JDialog {
Version version;
/**
* Creates new form VersionSettingsWindow
*/
public NewVersionWindow(java.awt.Frame parent, boolean modal, Version v) {
super(parent, modal);
initComponents();
version = v;
txtMaxMemory.setText(version.maxMemory);
txtName.setText(version.name);
txtGameDir.setText(version.gameDir);
txtJavaArgs.setText(version.javaArgs);
txtJavaDir.setText(version.javaDir);
chkOver16.setSelected(version.isVer16);
if (version.lastLoadLibraries == null) {
version.lastLoadLibraries = new ArrayList<String>();
}
if (version.firstLoadLibraries == null) {
version.firstLoadLibraries = new ArrayList<String>();
}
Dimension scrSize = Toolkit.getDefaultToolkit().getScreenSize();
setLocation((scrSize.width - this.getWidth()) / 2,
(scrSize.height - this.getHeight()) / 2);
}
void loadMinecraftVersion() {
java.util.ResourceBundle bundle = C.I18N; // NOI18N
String minecraftJar;
if (version.isVer16) {
minecraftJar = Utils.addSeparator(Utils.getGameDir(version, SettingsManager.settings.publicSettings.gameDir))
+ "versions" + File.separator + version.name + File.separator
+ version.name + ".jar";
} else {
minecraftJar = Utils.addSeparator(Utils.getGameDir(version, SettingsManager.settings.publicSettings.gameDir)) + "bin"
+ File.separator + "minecraft.jar";
}
minecraftVersion = Utils.minecraftVersion(new File(minecraftJar));
String text = "";
switch (minecraftVersion.type) {
case MinecraftVersionRequest.Invaild:
text = bundle.getString("invalid");
break;
case MinecraftVersionRequest.InvaildJar:
text = bundle.getString("invalid_jar");
break;
case MinecraftVersionRequest.NotAFile:
text = bundle.getString("not_a_file");
break;
case MinecraftVersionRequest.NotFound:
text = bundle.getString("not_found");
break;
case MinecraftVersionRequest.NotReadable:
text = bundle.getString("not_readable");
break;
case MinecraftVersionRequest.Modified:
text = bundle.getString("modified") + " ";
case MinecraftVersionRequest.OK:
text += minecraftVersion.version;
break;
case MinecraftVersionRequest.Unkown:
default:
text = "???";
break;
}
txtMinecraftVersion.setText(text);
}
int getCharShowTime(String s, char c) {
int res = 0;
for (int i = 0; i < s.length(); i++) {
if (s.charAt(i) == c) {
res++;
}
}
return res;
}
String formatVersion(String ver) {
int i = (getCharShowTime(ver, '.'));
if (i == 0) {
if (getCharShowTime(ver, 'w') > 0) {
return ver;
} else {
return ver + ".0.0";
}
} else if (i == 1) {
return ver + ".0";
} else {
return ver;
}
}
/**
* This method is called from within the constructor to initialize the form.
* WARNING: Do NOT modify this code. The content of this method is always
* regenerated by the Form Editor.
*/
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
jInternalFrame1 = new javax.swing.JInternalFrame();
jLabel1 = new javax.swing.JLabel();
txtName = new javax.swing.JTextField();
jSeparator1 = new javax.swing.JSeparator();
btnOK = new javax.swing.JButton();
btnCancel = new javax.swing.JButton();
jLabel4 = new javax.swing.JLabel();
jTabbedPane1 = new javax.swing.JTabbedPane();
jPanel1 = new javax.swing.JPanel();
jLabel7 = new javax.swing.JLabel();
txtGameDir = new javax.swing.JTextField();
txtJavaDir = new javax.swing.JTextField();
jLabel11 = new javax.swing.JLabel();
jLabel6 = new javax.swing.JLabel();
txtJavaArgs = new javax.swing.JTextField();
jLabel10 = new javax.swing.JLabel();
txtMaxMemory = new javax.swing.JTextField();
chkOver16 = new javax.swing.JCheckBox();
jLabel13 = new javax.swing.JLabel();
txtMinecraftVersion = new javax.swing.JTextField();
jInternalFrame1.setVisible(true);
javax.swing.GroupLayout jInternalFrame1Layout = new javax.swing.GroupLayout(jInternalFrame1.getContentPane());
jInternalFrame1.getContentPane().setLayout(jInternalFrame1Layout);
jInternalFrame1Layout.setHorizontalGroup(
jInternalFrame1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGap(0, 0, Short.MAX_VALUE)
);
jInternalFrame1Layout.setVerticalGroup(
jInternalFrame1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGap(0, 0, Short.MAX_VALUE)
);
setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
addWindowListener(new java.awt.event.WindowAdapter() {
public void windowClosed(java.awt.event.WindowEvent evt) {
formWindowClosed(evt);
}
});
java.util.ResourceBundle bundle = java.util.ResourceBundle.getBundle("org/jackhuang/hellominecraftlauncher/I18N"); // NOI18N
jLabel1.setText(bundle.getString("名称")); // NOI18N
jLabel1.setToolTipText("");
btnOK.setText(bundle.getString("确定")); // NOI18N
btnOK.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnOKActionPerformed(evt);
}
});
btnCancel.setText(bundle.getString("取消")); // NOI18N
btnCancel.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnCancelActionPerformed(evt);
}
});
jLabel4.setForeground(new java.awt.Color(255, 0, 0));
jLabel4.setText(bundle.getString("以下设置字段为空代表着使用默认设置")); // NOI18N
jLabel7.setText(bundle.getString("游戏路径")); // NOI18N
jLabel11.setText(bundle.getString("JAVA路径")); // NOI18N
jLabel6.setText(bundle.getString("JAVA虚拟机参数")); // NOI18N
jLabel10.setText(bundle.getString("最大内存")); // NOI18N
chkOver16.setText(bundle.getString("1.6及以上版本以及导入的旧版本")); // NOI18N
javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
jPanel1.setLayout(jPanel1Layout);
jPanel1Layout.setHorizontalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addContainerGap()
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(txtGameDir)
.addComponent(txtJavaDir)
.addComponent(txtMaxMemory)
.addComponent(txtJavaArgs)
.addGroup(jPanel1Layout.createSequentialGroup()
.addComponent(jLabel7)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 399, Short.MAX_VALUE)
.addComponent(chkOver16))
.addGroup(jPanel1Layout.createSequentialGroup()
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel11)
.addComponent(jLabel6)
.addComponent(jLabel10))
.addGap(0, 0, Short.MAX_VALUE)))
.addContainerGap())
);
jPanel1Layout.setVerticalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addContainerGap()
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel7)
.addComponent(chkOver16))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(txtGameDir, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jLabel11)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(txtJavaDir, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jLabel6)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(txtJavaArgs, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jLabel10)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(txtMaxMemory, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap(178, Short.MAX_VALUE))
);
jTabbedPane1.addTab("普通设置", jPanel1);
jLabel13.setText("Minecraft 版本");
txtMinecraftVersion.setEditable(false);
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jSeparator1)
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addComponent(jLabel4)
.addGap(0, 0, Short.MAX_VALUE))
.addComponent(jTabbedPane1)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
.addComponent(jLabel13)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(txtMinecraftVersion)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(btnCancel))
.addGroup(layout.createSequentialGroup()
.addComponent(jLabel1)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(txtName)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(btnOK)))))
.addContainerGap())
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel1)
.addComponent(txtName, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(btnOK))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel13)
.addComponent(txtMinecraftVersion, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(btnCancel))
.addGap(4, 4, 4)
.addComponent(jSeparator1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jLabel4)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jTabbedPane1)
.addContainerGap())
);
jTabbedPane1.getAccessibleContext().setAccessibleName("");
getAccessibleContext().setAccessibleDescription("");
pack();
}// </editor-fold>//GEN-END:initComponents
private void formWindowClosed(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_formWindowClosed
}//GEN-LAST:event_formWindowClosed
private void chkAdvancedSettingsActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_chkAdvancedSettingsActionPerformed
}//GEN-LAST:event_chkAdvancedSettingsActionPerformed
private void btnOKActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnOKActionPerformed
if (txtName.getText().trim().isEmpty()) {
MessageBox.Show(C.I18N.getString("版本名称不能为空"));
return;
}
version.gameDir = txtGameDir.getText();
version.isVer16 = chkOver16.isSelected();
version.javaArgs = txtJavaArgs.getText();
version.javaDir = txtJavaDir.getText();
version.maxMemory = txtMaxMemory.getText();
version.name = txtName.getText();
SettingsManager.setVersion(version);
SettingsManager.save();
this.dispose();
}//GEN-LAST:event_btnOKActionPerformed
private void btnCancelActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnCancelActionPerformed
this.dispose();
}//GEN-LAST:event_btnCancelActionPerformed
int progress, max;
MinecraftVersionRequest minecraftVersion;
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JButton btnCancel;
private javax.swing.JButton btnOK;
private javax.swing.JCheckBox chkOver16;
private javax.swing.JInternalFrame jInternalFrame1;
private javax.swing.JLabel jLabel1;
private javax.swing.JLabel jLabel10;
private javax.swing.JLabel jLabel11;
private javax.swing.JLabel jLabel13;
private javax.swing.JLabel jLabel4;
private javax.swing.JLabel jLabel6;
private javax.swing.JLabel jLabel7;
private javax.swing.JPanel jPanel1;
private javax.swing.JSeparator jSeparator1;
private javax.swing.JTabbedPane jTabbedPane1;
private javax.swing.JTextField txtGameDir;
private javax.swing.JTextField txtJavaArgs;
private javax.swing.JTextField txtJavaDir;
private javax.swing.JTextField txtMaxMemory;
private javax.swing.JTextField txtMinecraftVersion;
private javax.swing.JTextField txtName;
// End of variables declaration//GEN-END:variables
}
@@ -0,0 +1,548 @@
<?xml version="1.0" encoding="UTF-8" ?>
<Form version="1.3" maxVersion="1.8" type="org.netbeans.modules.form.forminfo.JDialogFormInfo">
<Properties>
<Property name="defaultCloseOperation" type="int" value="2"/>
<Property name="title" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="org/jackhuang/hellominecraftlauncher/I18N.properties" key="Options" replaceFormat="java.util.ResourceBundle.getBundle(&quot;{bundleNameSlashes}&quot;).getString(&quot;{key}&quot;)"/>
</Property>
</Properties>
<SyntheticProperties>
<SyntheticProperty name="formSizePolicy" type="int" value="1"/>
<SyntheticProperty name="generateCenter" type="boolean" value="false"/>
</SyntheticProperties>
<AuxValues>
<AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="0"/>
<AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/>
<AuxValue name="FormSettings_generateFQN" type="java.lang.Boolean" value="true"/>
<AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="false"/>
<AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="false"/>
<AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="1"/>
<AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/>
<AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/>
<AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/>
</AuxValues>
<Layout>
<DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0">
<EmptySpace min="0" pref="499" max="32767" attributes="0"/>
<Group type="103" rootIndex="1" groupAlignment="0" attributes="0">
<Group type="102" attributes="0">
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
<Component id="pnlMain" min="-2" max="-2" attributes="0"/>
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
</Group>
</Group>
</Group>
</DimensionLayout>
<DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0">
<EmptySpace min="0" pref="348" max="32767" attributes="0"/>
<Group type="103" rootIndex="1" groupAlignment="0" attributes="0">
<Group type="102" attributes="0">
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
<Component id="pnlMain" min="-2" max="-2" attributes="0"/>
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
</Group>
</Group>
</Group>
</DimensionLayout>
</Layout>
<SubComponents>
<Container class="javax.swing.JPanel" name="pnlMain">
<Layout>
<DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="1" attributes="0">
<Component id="pnlCard" max="32767" attributes="0"/>
<EmptySpace min="-2" pref="0" max="-2" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
<DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0">
<Component id="pnlCard" alignment="0" max="32767" attributes="0"/>
</Group>
</DimensionLayout>
</Layout>
<SubComponents>
<Container class="javax.swing.JPanel" name="pnlCard">
<Layout class="org.netbeans.modules.form.compat2.layouts.DesignCardLayout"/>
<SubComponents>
<Container class="javax.swing.JTabbedPane" name="tabMain">
<Properties>
<Property name="name" type="java.lang.String" value="tabMain" noResource="true"/>
</Properties>
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignCardLayout" value="org.netbeans.modules.form.compat2.layouts.DesignCardLayout$CardConstraintsDescription">
<CardConstraints cardName="card2"/>
</Constraint>
</Constraints>
<Layout class="org.netbeans.modules.form.compat2.layouts.support.JTabbedPaneSupportLayout"/>
<SubComponents>
<Container class="javax.swing.JPanel" name="pnlPublicSettings">
<AuxValues>
<AuxValue name="JavaCodeGenerator_CreateCodeCustom" type="java.lang.String" value="new javax.swing.JPanel()"/>
</AuxValues>
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.support.JTabbedPaneSupportLayout" value="org.netbeans.modules.form.compat2.layouts.support.JTabbedPaneSupportLayout$JTabbedPaneConstraintsDescription">
<JTabbedPaneConstraints tabName="&#x5168;&#x5c40;&#x8bbe;&#x7f6e;">
<Property name="tabTitle" type="java.lang.String" value="&#x5168;&#x5c40;&#x8bbe;&#x7f6e;"/>
</JTabbedPaneConstraints>
</Constraint>
</Constraints>
<Layout>
<DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Component id="txtMinecraftPath" alignment="0" max="32767" attributes="0"/>
<Group type="102" alignment="0" attributes="0">
<Component id="jLabel2" min="-2" max="-2" attributes="0"/>
<EmptySpace min="76" max="32767" attributes="0"/>
<Component id="btnSelMinecraftPath" min="-2" max="-2" attributes="0"/>
</Group>
<Group type="102" alignment="1" attributes="0">
<Component id="jLabel1" min="-2" max="-2" attributes="0"/>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Component id="txtMaxMemory" max="32767" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="jLabel3" min="-2" max="-2" attributes="0"/>
</Group>
<Group type="102" alignment="0" attributes="0">
<Component id="jLabel5" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="cboSource" max="32767" attributes="0"/>
</Group>
<Group type="102" alignment="1" attributes="0">
<Component id="jButton1" min="-2" max="-2" attributes="0"/>
<EmptySpace pref="176" max="32767" attributes="0"/>
<Component id="chkDisableMoveMods" min="-2" max="-2" attributes="0"/>
</Group>
</Group>
<EmptySpace max="-2" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
<DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="btnSelMinecraftPath" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="jLabel2" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace max="-2" attributes="0"/>
<Component id="txtMinecraftPath" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="jLabel1" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="txtMaxMemory" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="jLabel3" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="jLabel5" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="cboSource" alignment="3" min="-2" pref="26" max="-2" attributes="0"/>
</Group>
<EmptySpace pref="167" max="32767" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="chkDisableMoveMods" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="jButton1" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace max="-2" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
</Layout>
<SubComponents>
<Component class="javax.swing.JLabel" name="jLabel3">
<Properties>
<Property name="text" type="java.lang.String" value="MB"/>
</Properties>
</Component>
<Component class="javax.swing.JTextField" name="txtMaxMemory">
<Properties>
<Property name="toolTipText" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="org/jackhuang/hellominecraftlauncher/I18N.properties" key="MaxMemoryTooltip" replaceFormat="java.util.ResourceBundle.getBundle(&quot;{bundleNameSlashes}&quot;).getString(&quot;{key}&quot;)"/>
</Property>
<Property name="name" type="java.lang.String" value="txtMaxMemory" noResource="true"/>
</Properties>
<Events>
<EventHandler event="focusLost" listener="java.awt.event.FocusListener" parameters="java.awt.event.FocusEvent" handler="txtMaxMemoryFocusLost"/>
</Events>
</Component>
<Component class="javax.swing.JLabel" name="jLabel2">
<Properties>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="org/jackhuang/hellominecraftlauncher/I18N.properties" key="&#x6e38;&#x620f;&#x8def;&#x5f84;" replaceFormat="java.util.ResourceBundle.getBundle(&quot;{bundleNameSlashes}&quot;).getString(&quot;{key}&quot;)"/>
</Property>
<Property name="toolTipText" type="java.lang.String" value=""/>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="jLabel1">
<Properties>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="org/jackhuang/hellominecraftlauncher/I18N.properties" key="&#x6700;&#x5927;&#x5185;&#x5b58;" replaceFormat="java.util.ResourceBundle.getBundle(&quot;{bundleNameSlashes}&quot;).getString(&quot;{key}&quot;)"/>
</Property>
</Properties>
</Component>
<Component class="javax.swing.JTextField" name="txtMinecraftPath">
<Properties>
<Property name="toolTipText" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="org/jackhuang/hellominecraftlauncher/I18N.properties" key="MinecraftLocation" replaceFormat="java.util.ResourceBundle.getBundle(&quot;{bundleNameSlashes}&quot;).getString(&quot;{key}&quot;)"/>
</Property>
</Properties>
<Events>
<EventHandler event="focusLost" listener="java.awt.event.FocusListener" parameters="java.awt.event.FocusEvent" handler="txtMinecraftPathFocusLost"/>
</Events>
</Component>
<Component class="javax.swing.JButton" name="btnSelMinecraftPath">
<Properties>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="org/jackhuang/hellominecraftlauncher/I18N.properties" key="&#x624b;&#x52a8;&#x8bbe;&#x7f6e;" replaceFormat="java.util.ResourceBundle.getBundle(&quot;{bundleNameSlashes}&quot;).getString(&quot;{key}&quot;)"/>
</Property>
<Property name="toolTipText" type="java.lang.String" value=""/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnSelMinecraftPathActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JButton" name="jButton1">
<Properties>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="org/jackhuang/hellominecraftlauncher/I18N.properties" key="&#x67e5;&#x770b;&#x65e5;&#x5fd7;" replaceFormat="java.util.ResourceBundle.getBundle(&quot;{bundleNameSlashes}&quot;).getString(&quot;{key}&quot;)"/>
</Property>
<Property name="toolTipText" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="org/jackhuang/hellominecraftlauncher/I18N.properties" key="ShowConsoleOutput" replaceFormat="java.util.ResourceBundle.getBundle(&quot;{bundleNameSlashes}&quot;).getString(&quot;{key}&quot;)"/>
</Property>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jButton1ActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JCheckBox" name="chkDisableMoveMods">
<Properties>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="org/jackhuang/hellominecraftlauncher/I18N.properties" key="DisableMoveMods" replaceFormat="java.util.ResourceBundle.getBundle(&quot;{bundleNameSlashes}&quot;).getString(&quot;{key}&quot;)"/>
</Property>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="chkDisableMoveModsActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JComboBox" name="cboSource">
<Properties>
<Property name="model" type="javax.swing.ComboBoxModel" editor="org.netbeans.modules.form.editors2.ComboBoxModelEditor">
<StringArray count="2">
<StringItem index="0" value="Mojang"/>
<StringItem index="1" value="BMCL"/>
</StringArray>
</Property>
</Properties>
<Events>
<EventHandler event="itemStateChanged" listener="java.awt.event.ItemListener" parameters="java.awt.event.ItemEvent" handler="cboSourceItemStateChanged"/>
</Events>
</Component>
<Component class="javax.swing.JLabel" name="jLabel5">
<Properties>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="org/jackhuang/hellominecraftlauncher/I18N.properties" key="DownloadSource" replaceFormat="java.util.ResourceBundle.getBundle(&quot;{bundleNameSlashes}&quot;).getString(&quot;{key}&quot;)"/>
</Property>
</Properties>
</Component>
</SubComponents>
</Container>
<Container class="javax.swing.JPanel" name="jPanel2">
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.support.JTabbedPaneSupportLayout" value="org.netbeans.modules.form.compat2.layouts.support.JTabbedPaneSupportLayout$JTabbedPaneConstraintsDescription">
<JTabbedPaneConstraints tabName="&#x68c0;&#x67e5;&#x66f4;&#x65b0;">
<Property name="tabTitle" type="java.lang.String" value="&#x68c0;&#x67e5;&#x66f4;&#x65b0;"/>
</JTabbedPaneConstraints>
</Constraint>
</Constraints>
<Layout>
<DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Component id="jLabel4" pref="474" max="32767" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
<DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="1" attributes="0">
<EmptySpace pref="209" max="32767" attributes="0"/>
<Component id="jLabel4" min="-2" pref="100" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
</Layout>
<SubComponents>
<Component class="javax.swing.JLabel" name="jLabel4">
<Properties>
<Property name="text" type="java.lang.String" value="&lt;html&gt;&#xa;&#x4f5c;&#x8005;&#xff1a;&lt;br /&gt;&#xa;&#x767e;&#x5ea6;ID&#xff1a;huanghongxun20&lt;br /&gt;&#xa;mcbbs&#xff1a;huanghongxun&lt;br /&gt;&#xa;&#x90ae;&#x7bb1;&#xff1a;huanghongxun2008@126.com&lt;br /&gt;&#xa;&lt;br /&gt;&#xa;&#x6b22;&#x8fce;&#x4e3e;&#x62a5;Bug&#x54e6;&#xa;&lt;/html&gt;"/>
</Properties>
</Component>
</SubComponents>
</Container>
<Container class="javax.swing.JPanel" name="jPanel18">
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.support.JTabbedPaneSupportLayout" value="org.netbeans.modules.form.compat2.layouts.support.JTabbedPaneSupportLayout$JTabbedPaneConstraintsDescription">
<JTabbedPaneConstraints tabName="&#x63d2;&#x4ef6;&#x4e2d;&#x5fc3;">
<Property name="tabTitle" type="java.lang.String" value="&#x63d2;&#x4ef6;&#x4e2d;&#x5fc3;"/>
</JTabbedPaneConstraints>
</Constraint>
</Constraints>
<Layout>
<DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<Component id="jScrollPane1" min="-2" pref="152" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="1" attributes="0">
<Group type="102" alignment="0" attributes="0">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<Component id="jLabel14" min="-2" max="-2" attributes="0"/>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Component id="lblPluginName" min="-2" max="-2" attributes="0"/>
</Group>
<Group type="102" alignment="0" attributes="0">
<Component id="jLabel15" min="-2" max="-2" attributes="0"/>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Component id="lblPluginVersion" min="-2" max="-2" attributes="0"/>
</Group>
<Component id="jLabel17" alignment="0" min="-2" max="-2" attributes="0"/>
<Group type="102" alignment="0" attributes="0">
<Component id="jLabel16" min="-2" max="-2" attributes="0"/>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Component id="lblPluginAuthors" min="-2" max="-2" attributes="0"/>
</Group>
</Group>
<EmptySpace min="0" pref="296" max="32767" attributes="0"/>
</Group>
<Component id="jScrollPane3" alignment="0" max="32767" attributes="0"/>
<Group type="102" alignment="1" attributes="0">
<Component id="lblPluginActive" min="-2" max="-2" attributes="0"/>
<EmptySpace pref="197" max="32767" attributes="0"/>
<Component id="btnPluginSettings" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
</Group>
</Group>
</Group>
</Group>
</DimensionLayout>
<DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0">
<Component id="jScrollPane1" alignment="0" max="32767" attributes="0"/>
<Group type="102" alignment="0" attributes="0">
<Group type="103" groupAlignment="3" attributes="0">
<Component id="jLabel14" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="lblPluginName" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="jLabel15" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="lblPluginVersion" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="jLabel16" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="lblPluginAuthors" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace min="-2" pref="44" max="-2" attributes="0"/>
<Component id="jLabel17" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="jScrollPane3" pref="150" max="32767" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="btnPluginSettings" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="lblPluginActive" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace max="-2" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
</Layout>
<SubComponents>
<Container class="javax.swing.JScrollPane" name="jScrollPane1">
<AuxValues>
<AuxValue name="autoScrollPane" type="java.lang.Boolean" value="true"/>
</AuxValues>
<Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/>
<SubComponents>
<Component class="javax.swing.JList" name="lstPlugins">
<Properties>
<Property name="model" type="javax.swing.ListModel" editor="org.netbeans.modules.form.editors2.ListModelEditor">
<StringArray count="0"/>
</Property>
</Properties>
<Events>
<EventHandler event="valueChanged" listener="javax.swing.event.ListSelectionListener" parameters="javax.swing.event.ListSelectionEvent" handler="lstPluginsValueChanged"/>
</Events>
</Component>
</SubComponents>
</Container>
<Component class="javax.swing.JLabel" name="jLabel14">
<Properties>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="org/jackhuang/hellominecraftlauncher/I18N.properties" key="Name" replaceFormat="java.util.ResourceBundle.getBundle(&quot;{bundleNameSlashes}&quot;).getString(&quot;{key}&quot;)"/>
</Property>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="jLabel15">
<Properties>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="org/jackhuang/hellominecraftlauncher/I18N.properties" key="Version" replaceFormat="java.util.ResourceBundle.getBundle(&quot;{bundleNameSlashes}&quot;).getString(&quot;{key}&quot;)"/>
</Property>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="jLabel16">
<Properties>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="org/jackhuang/hellominecraftlauncher/I18N.properties" key="Authors" replaceFormat="java.util.ResourceBundle.getBundle(&quot;{bundleNameSlashes}&quot;).getString(&quot;{key}&quot;)"/>
</Property>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="jLabel17">
<Properties>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="org/jackhuang/hellominecraftlauncher/I18N.properties" key="Details" replaceFormat="java.util.ResourceBundle.getBundle(&quot;{bundleNameSlashes}&quot;).getString(&quot;{key}&quot;)"/>
</Property>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="lblPluginName">
<Properties>
<Property name="text" type="java.lang.String" value="0"/>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="lblPluginVersion">
<Properties>
<Property name="text" type="java.lang.String" value="0"/>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="lblPluginAuthors">
<Properties>
<Property name="text" type="java.lang.String" value="0"/>
</Properties>
</Component>
<Container class="javax.swing.JScrollPane" name="jScrollPane3">
<AuxValues>
<AuxValue name="autoScrollPane" type="java.lang.Boolean" value="true"/>
</AuxValues>
<Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/>
<SubComponents>
<Component class="javax.swing.JTextPane" name="txtPluginDescription">
</Component>
</SubComponents>
</Container>
<Component class="javax.swing.JButton" name="btnPluginSettings">
<Properties>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="org/jackhuang/hellominecraftlauncher/I18N.properties" key="PluginSettings" replaceFormat="java.util.ResourceBundle.getBundle(&quot;{bundleNameSlashes}&quot;).getString(&quot;{key}&quot;)"/>
</Property>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnPluginSettingsActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JLabel" name="lblPluginActive">
<Properties>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="org/jackhuang/hellominecraftlauncher/I18N.properties" key="IsLoaded" replaceFormat="java.util.ResourceBundle.getBundle(&quot;{bundleNameSlashes}&quot;).getString(&quot;{key}&quot;)"/>
</Property>
<Property name="toolTipText" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="org/jackhuang/hellominecraftlauncher/I18N.properties" key="ShowIfIsLoaded" replaceFormat="java.util.ResourceBundle.getBundle(&quot;{bundleNameSlashes}&quot;).getString(&quot;{key}&quot;)"/>
</Property>
</Properties>
<Events>
<EventHandler event="mouseClicked" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="lblPluginActiveMouseClicked"/>
</Events>
</Component>
</SubComponents>
</Container>
<Container class="javax.swing.JPanel" name="jPanel1">
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.support.JTabbedPaneSupportLayout" value="org.netbeans.modules.form.compat2.layouts.support.JTabbedPaneSupportLayout$JTabbedPaneConstraintsDescription">
<JTabbedPaneConstraints tabName="&#x4e2a;&#x6027;&#x5316;">
<Property name="tabTitle" type="java.lang.String" value="&#x4e2a;&#x6027;&#x5316;"/>
</JTabbedPaneConstraints>
</Constraint>
</Constraints>
<Layout>
<DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Component id="jLabel6" min="-2" max="-2" attributes="0"/>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Component id="txtBackgroundPath" pref="329" max="32767" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="btnSelBackgroundPath" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
<DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="jLabel6" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="txtBackgroundPath" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="btnSelBackgroundPath" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace pref="286" max="32767" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
</Layout>
<SubComponents>
<Component class="javax.swing.JLabel" name="jLabel6">
<Properties>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="org/jackhuang/hellominecraftlauncher/I18N.properties" key="&#x80cc;&#x666f;&#x5730;&#x5740;" replaceFormat="java.util.ResourceBundle.getBundle(&quot;{bundleNameSlashes}&quot;).getString(&quot;{key}&quot;)"/>
</Property>
<Property name="toolTipText" type="java.lang.String" value=""/>
</Properties>
</Component>
<Component class="javax.swing.JTextField" name="txtBackgroundPath">
<Events>
<EventHandler event="focusLost" listener="java.awt.event.FocusListener" parameters="java.awt.event.FocusEvent" handler="txtBackgroundPathFocusLost"/>
</Events>
</Component>
<Component class="javax.swing.JButton" name="btnSelBackgroundPath">
<Properties>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="org/jackhuang/hellominecraftlauncher/I18N.properties" key="&#x624b;&#x52a8;&#x8bbe;&#x7f6e;" replaceFormat="java.util.ResourceBundle.getBundle(&quot;{bundleNameSlashes}&quot;).getString(&quot;{key}&quot;)"/>
</Property>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnSelBackgroundPathActionPerformed"/>
</Events>
</Component>
</SubComponents>
</Container>
</SubComponents>
</Container>
</SubComponents>
</Container>
</SubComponents>
</Container>
</SubComponents>
</Form>
@@ -0,0 +1,562 @@
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package org.jackhuang.hellominecraftlauncher.views;
import java.awt.Dimension;
import java.awt.Toolkit;
import javax.swing.DefaultListModel;
import javax.swing.JFileChooser;
import javax.swing.JPanel;
import org.jackhuang.hellominecraftlauncher.apis.Plugin;
import org.jackhuang.hellominecraftlauncher.apis.utils.MessageBox;
import org.jackhuang.hellominecraftlauncher.apis.utils.Utils;
import org.jackhuang.hellominecraftlauncher.plugin.PluginHandler;
import org.jackhuang.hellominecraftlauncher.plugin.PluginManager;
import org.jackhuang.hellominecraftlauncher.utilities.C;
import org.jackhuang.hellominecraftlauncher.utilities.SettingsManager;
/**
*
* @author hyh
*/
public class OptionsWindow extends javax.swing.JDialog {
// <editor-fold defaultstate="collapsed" desc="Variables">
DefaultListModel lstPluginsModel = new DefaultListModel();
// </editor-fold>
// <editor-fold defaultstate="collapsed" desc="Constructor">
public OptionsWindow(java.awt.Frame parent, boolean modal) {
super(parent, modal);
initComponents();
Dimension scrSize = Toolkit.getDefaultToolkit().getScreenSize();
setLocation((scrSize.width - this.getWidth()) / 2,
(scrSize.height - this.getHeight()) / 2);
preparePlugins();
txtBackgroundPath.setText(MainWindow.getInstance().backgroundPath);
cboSource.setSelectedIndex(SettingsManager.settings.downloadtype);
txtMaxMemory.setText(String.valueOf(SettingsManager.settings.publicSettings.maxMemory));
txtMinecraftPath.setText(SettingsManager.settings.publicSettings.gameDir);
chkDisableMoveMods.setSelected(SettingsManager.settings.disableMoveMods);
for (JPanel panel : PluginHandler.mainPanels) {
tabMain.addTab(panel.getName(), panel);
}
}
// </editor-fold>
// <editor-fold defaultstate="collapsed" desc="Load">
private void preparePlugins() {
lstPluginsModel.clear();
for (Plugin p : PluginManager.pluginAnnotations) {
lstPluginsModel.addElement(p.pluginName());
}
lstPlugins.setModel(lstPluginsModel);
}
private void prepareAPlugin(int idx) {
Plugin p = PluginManager.pluginAnnotations.get(idx);
lblPluginName.setText(p.pluginName());
lblPluginVersion.setText(p.pluginVer());
lblPluginAuthors.setText(p.authors());
txtPluginDescription.setText(p.description());
lblPluginActive.setText(PluginManager.pluginError.get(idx) == null ? C.I18N.getString("Loaded") : C.I18N.getString("FailedToLoad"));
}
//</editor-fold>
// <editor-fold defaultstate="collapsed" desc="Statics">
static {
instance = new OptionsWindow(null, true);
}
public static OptionsWindow getInstance() {
return instance;
}
private static OptionsWindow instance;
// </editor-fold>
// <editor-fold defaultstate="collapsed" desc="UI">
/**
* This method is called from within the constructor to initialize the form.
* WARNING: Do NOT modify this code. The content of this method is always
* regenerated by the Form Editor.
*/
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
pnlMain = new javax.swing.JPanel();
pnlCard = new javax.swing.JPanel();
tabMain = new javax.swing.JTabbedPane();
pnlPublicSettings = new javax.swing.JPanel();
jLabel3 = new javax.swing.JLabel();
txtMaxMemory = new javax.swing.JTextField();
jLabel2 = new javax.swing.JLabel();
jLabel1 = new javax.swing.JLabel();
txtMinecraftPath = new javax.swing.JTextField();
btnSelMinecraftPath = new javax.swing.JButton();
jButton1 = new javax.swing.JButton();
chkDisableMoveMods = new javax.swing.JCheckBox();
cboSource = new javax.swing.JComboBox();
jLabel5 = new javax.swing.JLabel();
jPanel2 = new javax.swing.JPanel();
jLabel4 = new javax.swing.JLabel();
jPanel18 = new javax.swing.JPanel();
jScrollPane1 = new javax.swing.JScrollPane();
lstPlugins = new javax.swing.JList();
jLabel14 = new javax.swing.JLabel();
jLabel15 = new javax.swing.JLabel();
jLabel16 = new javax.swing.JLabel();
jLabel17 = new javax.swing.JLabel();
lblPluginName = new javax.swing.JLabel();
lblPluginVersion = new javax.swing.JLabel();
lblPluginAuthors = new javax.swing.JLabel();
jScrollPane3 = new javax.swing.JScrollPane();
txtPluginDescription = new javax.swing.JTextPane();
btnPluginSettings = new javax.swing.JButton();
lblPluginActive = new javax.swing.JLabel();
jPanel1 = new javax.swing.JPanel();
jLabel6 = new javax.swing.JLabel();
txtBackgroundPath = new javax.swing.JTextField();
btnSelBackgroundPath = new javax.swing.JButton();
setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
java.util.ResourceBundle bundle = java.util.ResourceBundle.getBundle("org/jackhuang/hellominecraftlauncher/I18N"); // NOI18N
setTitle(bundle.getString("Options")); // NOI18N
pnlCard.setLayout(new java.awt.CardLayout());
tabMain.setName("tabMain"); // NOI18N
jLabel3.setText("MB");
txtMaxMemory.setToolTipText(bundle.getString("MaxMemoryTooltip")); // NOI18N
txtMaxMemory.setName("txtMaxMemory"); // NOI18N
txtMaxMemory.addFocusListener(new java.awt.event.FocusAdapter() {
public void focusLost(java.awt.event.FocusEvent evt) {
txtMaxMemoryFocusLost(evt);
}
});
jLabel2.setText(bundle.getString("游戏路径")); // NOI18N
jLabel2.setToolTipText("");
jLabel1.setText(bundle.getString("最大内存")); // NOI18N
txtMinecraftPath.setToolTipText(bundle.getString("MinecraftLocation")); // NOI18N
txtMinecraftPath.addFocusListener(new java.awt.event.FocusAdapter() {
public void focusLost(java.awt.event.FocusEvent evt) {
txtMinecraftPathFocusLost(evt);
}
});
btnSelMinecraftPath.setText(bundle.getString("手动设置")); // NOI18N
btnSelMinecraftPath.setToolTipText("");
btnSelMinecraftPath.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnSelMinecraftPathActionPerformed(evt);
}
});
jButton1.setText(bundle.getString("查看日志")); // NOI18N
jButton1.setToolTipText(bundle.getString("ShowConsoleOutput")); // NOI18N
jButton1.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton1ActionPerformed(evt);
}
});
chkDisableMoveMods.setText(bundle.getString("DisableMoveMods")); // NOI18N
chkDisableMoveMods.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
chkDisableMoveModsActionPerformed(evt);
}
});
cboSource.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Mojang", "BMCL" }));
cboSource.addItemListener(new java.awt.event.ItemListener() {
public void itemStateChanged(java.awt.event.ItemEvent evt) {
cboSourceItemStateChanged(evt);
}
});
jLabel5.setText(bundle.getString("DownloadSource")); // NOI18N
javax.swing.GroupLayout pnlPublicSettingsLayout = new javax.swing.GroupLayout(pnlPublicSettings);
pnlPublicSettings.setLayout(pnlPublicSettingsLayout);
pnlPublicSettingsLayout.setHorizontalGroup(
pnlPublicSettingsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(pnlPublicSettingsLayout.createSequentialGroup()
.addContainerGap()
.addGroup(pnlPublicSettingsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(txtMinecraftPath)
.addGroup(pnlPublicSettingsLayout.createSequentialGroup()
.addComponent(jLabel2)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(btnSelMinecraftPath))
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, pnlPublicSettingsLayout.createSequentialGroup()
.addComponent(jLabel1)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(txtMaxMemory)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jLabel3))
.addGroup(pnlPublicSettingsLayout.createSequentialGroup()
.addComponent(jLabel5)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(cboSource, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, pnlPublicSettingsLayout.createSequentialGroup()
.addComponent(jButton1)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 176, Short.MAX_VALUE)
.addComponent(chkDisableMoveMods)))
.addContainerGap())
);
pnlPublicSettingsLayout.setVerticalGroup(
pnlPublicSettingsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(pnlPublicSettingsLayout.createSequentialGroup()
.addContainerGap()
.addGroup(pnlPublicSettingsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(btnSelMinecraftPath)
.addComponent(jLabel2))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(txtMinecraftPath, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(pnlPublicSettingsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel1)
.addComponent(txtMaxMemory, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel3))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(pnlPublicSettingsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel5)
.addComponent(cboSource, javax.swing.GroupLayout.PREFERRED_SIZE, 26, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 167, Short.MAX_VALUE)
.addGroup(pnlPublicSettingsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(chkDisableMoveMods)
.addComponent(jButton1))
.addContainerGap())
);
tabMain.addTab("全局设置", pnlPublicSettings);
jLabel4.setText("<html>\n作者:<br />\n百度ID:huanghongxun20<br />\nmcbbs:huanghongxun<br />\n邮箱:huanghongxun2008@126.com<br />\n<br />\n欢迎举报Bug哦\n</html>");
javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
jPanel2.setLayout(jPanel2Layout);
jPanel2Layout.setHorizontalGroup(
jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel2Layout.createSequentialGroup()
.addContainerGap()
.addComponent(jLabel4, javax.swing.GroupLayout.DEFAULT_SIZE, 474, Short.MAX_VALUE)
.addContainerGap())
);
jPanel2Layout.setVerticalGroup(
jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel2Layout.createSequentialGroup()
.addContainerGap(209, Short.MAX_VALUE)
.addComponent(jLabel4, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap())
);
tabMain.addTab("检查更新", jPanel2);
lstPlugins.addListSelectionListener(new javax.swing.event.ListSelectionListener() {
public void valueChanged(javax.swing.event.ListSelectionEvent evt) {
lstPluginsValueChanged(evt);
}
});
jScrollPane1.setViewportView(lstPlugins);
jLabel14.setText(bundle.getString("Name")); // NOI18N
jLabel15.setText(bundle.getString("Version")); // NOI18N
jLabel16.setText(bundle.getString("Authors")); // NOI18N
jLabel17.setText(bundle.getString("Details")); // NOI18N
lblPluginName.setText("0");
lblPluginVersion.setText("0");
lblPluginAuthors.setText("0");
jScrollPane3.setViewportView(txtPluginDescription);
btnPluginSettings.setText(bundle.getString("PluginSettings")); // NOI18N
btnPluginSettings.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnPluginSettingsActionPerformed(evt);
}
});
lblPluginActive.setText(bundle.getString("IsLoaded")); // NOI18N
lblPluginActive.setToolTipText(bundle.getString("ShowIfIsLoaded")); // NOI18N
lblPluginActive.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
lblPluginActiveMouseClicked(evt);
}
});
javax.swing.GroupLayout jPanel18Layout = new javax.swing.GroupLayout(jPanel18);
jPanel18.setLayout(jPanel18Layout);
jPanel18Layout.setHorizontalGroup(
jPanel18Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel18Layout.createSequentialGroup()
.addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 152, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jPanel18Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel18Layout.createSequentialGroup()
.addGroup(jPanel18Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel18Layout.createSequentialGroup()
.addComponent(jLabel14)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(lblPluginName))
.addGroup(jPanel18Layout.createSequentialGroup()
.addComponent(jLabel15)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(lblPluginVersion))
.addComponent(jLabel17)
.addGroup(jPanel18Layout.createSequentialGroup()
.addComponent(jLabel16)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(lblPluginAuthors)))
.addGap(0, 296, Short.MAX_VALUE))
.addComponent(jScrollPane3, javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel18Layout.createSequentialGroup()
.addComponent(lblPluginActive)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 197, Short.MAX_VALUE)
.addComponent(btnPluginSettings)
.addContainerGap())))
);
jPanel18Layout.setVerticalGroup(
jPanel18Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jScrollPane1)
.addGroup(jPanel18Layout.createSequentialGroup()
.addGroup(jPanel18Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel14)
.addComponent(lblPluginName))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addGroup(jPanel18Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel15)
.addComponent(lblPluginVersion))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addGroup(jPanel18Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel16)
.addComponent(lblPluginAuthors))
.addGap(44, 44, 44)
.addComponent(jLabel17)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jScrollPane3, javax.swing.GroupLayout.DEFAULT_SIZE, 150, Short.MAX_VALUE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jPanel18Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(btnPluginSettings)
.addComponent(lblPluginActive))
.addContainerGap())
);
tabMain.addTab("插件中心", jPanel18);
jLabel6.setText(bundle.getString("背景地址")); // NOI18N
jLabel6.setToolTipText("");
txtBackgroundPath.addFocusListener(new java.awt.event.FocusAdapter() {
public void focusLost(java.awt.event.FocusEvent evt) {
txtBackgroundPathFocusLost(evt);
}
});
btnSelBackgroundPath.setText(bundle.getString("手动设置")); // NOI18N
btnSelBackgroundPath.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnSelBackgroundPathActionPerformed(evt);
}
});
javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
jPanel1.setLayout(jPanel1Layout);
jPanel1Layout.setHorizontalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addContainerGap()
.addComponent(jLabel6)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(txtBackgroundPath, javax.swing.GroupLayout.DEFAULT_SIZE, 329, Short.MAX_VALUE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(btnSelBackgroundPath)
.addContainerGap())
);
jPanel1Layout.setVerticalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addContainerGap()
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel6)
.addComponent(txtBackgroundPath, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(btnSelBackgroundPath))
.addContainerGap(286, Short.MAX_VALUE))
);
tabMain.addTab("个性化", jPanel1);
pnlCard.add(tabMain, "card2");
javax.swing.GroupLayout pnlMainLayout = new javax.swing.GroupLayout(pnlMain);
pnlMain.setLayout(pnlMainLayout);
pnlMainLayout.setHorizontalGroup(
pnlMainLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, pnlMainLayout.createSequentialGroup()
.addComponent(pnlCard, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addGap(0, 0, 0))
);
pnlMainLayout.setVerticalGroup(
pnlMainLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(pnlCard, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
);
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGap(0, 499, Short.MAX_VALUE)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGap(0, 0, Short.MAX_VALUE)
.addComponent(pnlMain, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(0, 0, Short.MAX_VALUE)))
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGap(0, 348, Short.MAX_VALUE)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGap(0, 0, Short.MAX_VALUE)
.addComponent(pnlMain, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(0, 0, Short.MAX_VALUE)))
);
pack();
}// </editor-fold>//GEN-END:initComponents
// <editor-fold defaultstate="collapsed" desc="Events">
private void txtMaxMemoryFocusLost(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_txtMaxMemoryFocusLost
SettingsManager.settings.publicSettings.maxMemory = txtMaxMemory.getText();
SettingsManager.save();
}//GEN-LAST:event_txtMaxMemoryFocusLost
private void txtMinecraftPathFocusLost(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_txtMinecraftPathFocusLost
SettingsManager.settings.publicSettings.gameDir = Utils.removeLastSeparator(txtMinecraftPath.getText());
SettingsManager.save();
MainWindow.getInstance().onRefreshMinecrafts();
}//GEN-LAST:event_txtMinecraftPathFocusLost
private void btnSelMinecraftPathActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnSelMinecraftPathActionPerformed
JFileChooser fc = new JFileChooser();
fc.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
fc.setDialogTitle(C.I18N.getString("选择MINECRAFT路径"));
fc.setMultiSelectionEnabled(false);
fc.showOpenDialog(this);
try {
String path = fc.getSelectedFile().getCanonicalPath();
path = Utils.removeLastSeparator(path);
txtMinecraftPath.setText(path);
SettingsManager.settings.publicSettings.gameDir = path;
SettingsManager.save();
} catch (Exception e) {
MessageBox.Show(C.I18N.getString("设置失败:") + e.getMessage());
}
}//GEN-LAST:event_btnSelMinecraftPathActionPerformed
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
LogWindow.instance.setVisible(true);
}//GEN-LAST:event_jButton1ActionPerformed
private void chkDisableMoveModsActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_chkDisableMoveModsActionPerformed
SettingsManager.settings.disableMoveMods = chkDisableMoveMods.isSelected();
SettingsManager.save();
}//GEN-LAST:event_chkDisableMoveModsActionPerformed
private void cboSourceItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_cboSourceItemStateChanged
SettingsManager.settings.downloadtype = cboSource.getSelectedIndex();
SettingsManager.save();
}//GEN-LAST:event_cboSourceItemStateChanged
private void lstPluginsValueChanged(javax.swing.event.ListSelectionEvent evt) {//GEN-FIRST:event_lstPluginsValueChanged
prepareAPlugin(lstPlugins.getSelectedIndex());
}//GEN-LAST:event_lstPluginsValueChanged
private void btnPluginSettingsActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnPluginSettingsActionPerformed
PluginManager.showSettingsDialog(lstPlugins.getSelectedIndex());
}//GEN-LAST:event_btnPluginSettingsActionPerformed
private void lblPluginActiveMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lblPluginActiveMouseClicked
MessageBox.Show(PluginManager.pluginError.get(lstPlugins.getSelectedIndex()));
}//GEN-LAST:event_lblPluginActiveMouseClicked
private void txtBackgroundPathFocusLost(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_txtBackgroundPathFocusLost
String path = txtBackgroundPath.getText();
SettingsManager.settings.bgpath = path;
SettingsManager.save();
MainWindow.getInstance().onResizeBackgroundLabel(path);
}//GEN-LAST:event_txtBackgroundPathFocusLost
private void btnSelBackgroundPathActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnSelBackgroundPathActionPerformed
JFileChooser fc = new JFileChooser();
fc.setFileSelectionMode(JFileChooser.FILES_ONLY);
fc.setDialogTitle(C.I18N.getString("选择背景路径"));
fc.setMultiSelectionEnabled(false);
fc.showOpenDialog(this);
try {
String path = fc.getSelectedFile().getCanonicalPath();
path = Utils.removeLastSeparator(path);
txtBackgroundPath.setText(path);
SettingsManager.settings.bgpath = path;
SettingsManager.save();
MainWindow.getInstance().onResizeBackgroundLabel(path);
} catch (Exception e) {
MessageBox.Show(C.I18N.getString("设置失败:") + e.getMessage());
}
}//GEN-LAST:event_btnSelBackgroundPathActionPerformed
// </editor-fold>
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JButton btnPluginSettings;
private javax.swing.JButton btnSelBackgroundPath;
private javax.swing.JButton btnSelMinecraftPath;
private javax.swing.JComboBox cboSource;
private javax.swing.JCheckBox chkDisableMoveMods;
private javax.swing.JButton jButton1;
private javax.swing.JLabel jLabel1;
private javax.swing.JLabel jLabel14;
private javax.swing.JLabel jLabel15;
private javax.swing.JLabel jLabel16;
private javax.swing.JLabel jLabel17;
private javax.swing.JLabel jLabel2;
private javax.swing.JLabel jLabel3;
private javax.swing.JLabel jLabel4;
private javax.swing.JLabel jLabel5;
private javax.swing.JLabel jLabel6;
private javax.swing.JPanel jPanel1;
private javax.swing.JPanel jPanel18;
private javax.swing.JPanel jPanel2;
private javax.swing.JScrollPane jScrollPane1;
private javax.swing.JScrollPane jScrollPane3;
private javax.swing.JLabel lblPluginActive;
private javax.swing.JLabel lblPluginAuthors;
private javax.swing.JLabel lblPluginName;
private javax.swing.JLabel lblPluginVersion;
private javax.swing.JList lstPlugins;
private javax.swing.JPanel pnlCard;
private javax.swing.JPanel pnlMain;
private javax.swing.JPanel pnlPublicSettings;
private javax.swing.JTabbedPane tabMain;
private javax.swing.JTextField txtBackgroundPath;
private javax.swing.JTextField txtMaxMemory;
private javax.swing.JTextField txtMinecraftPath;
private javax.swing.JTextPane txtPluginDescription;
// End of variables declaration//GEN-END:variables
//</editor-fold>
}
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
+60
View File
@@ -0,0 +1,60 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="zh">
<head>
<!-- Generated by javadoc (version 1.7.0_15) on Wed Jan 01 21:27:29 CST 2014 -->
<meta http-equiv="Content-Type" content="text/html" charset="UTF-8">
<title>所有类</title>
<meta name="date" content="2014-01-01">
<link rel="stylesheet" type="text/css" href="stylesheet.css" title="Style">
</head>
<body>
<h1 class="bar">所有类</h1>
<div class="indexContainer">
<ul>
<li><a href="org/jackhuang/hellominecraftlauncher/apis/utils/Compressor.html" title="org.jackhuang.hellominecraftlauncher.apis.utils中的类" target="classFrame">Compressor</a></li>
<li><a href="org/jackhuang/hellominecraftlauncher/apis/Configuration.html" title="org.jackhuang.hellominecraftlauncher.apis中的类" target="classFrame">Configuration</a></li>
<li><a href="org/jackhuang/hellominecraftlauncher/apis/DoneListener.html" title="org.jackhuang.hellominecraftlauncher.apis中的接口" target="classFrame"><i>DoneListener</i></a></li>
<li><a href="org/jackhuang/hellominecraftlauncher/download/DownloadAllThread.html" title="org.jackhuang.hellominecraftlauncher.download中的类" target="classFrame">DownloadAllThread</a></li>
<li><a href="org/jackhuang/hellominecraftlauncher/download/DownloadListener.html" title="org.jackhuang.hellominecraftlauncher.download中的接口" target="classFrame"><i>DownloadListener</i></a></li>
<li><a href="org/jackhuang/hellominecraftlauncher/download/DownloadType.html" title="org.jackhuang.hellominecraftlauncher.download中的枚举" target="classFrame">DownloadType</a></li>
<li><a href="org/jackhuang/hellominecraftlauncher/download/DownloadUtils.html" title="org.jackhuang.hellominecraftlauncher.download中的类" target="classFrame">DownloadUtils</a></li>
<li><a href="org/jackhuang/hellominecraftlauncher/apis/utils/FolderOpener.html" title="org.jackhuang.hellominecraftlauncher.apis.utils中的类" target="classFrame">FolderOpener</a></li>
<li><a href="org/jackhuang/hellominecraftlauncher/apis/events/HMCLPluginLoadEvent.html" title="org.jackhuang.hellominecraftlauncher.apis.events中的类" target="classFrame">HMCLPluginLoadEvent</a></li>
<li><a href="org/jackhuang/hellominecraftlauncher/apis/events/HMCLPluginUnloadEvent.html" title="org.jackhuang.hellominecraftlauncher.apis.events中的类" target="classFrame">HMCLPluginUnloadEvent</a></li>
<li><a href="org/jackhuang/hellominecraftlauncher/apis/events/HMCLPluginVersionChangedEvent.html" title="org.jackhuang.hellominecraftlauncher.apis.events中的类" target="classFrame">HMCLPluginVersionChangedEvent</a></li>
<li><a href="org/jackhuang/hellominecraftlauncher/download/HttpDownloader.html" title="org.jackhuang.hellominecraftlauncher.download中的类" target="classFrame">HttpDownloader</a></li>
<li><a href="org/jackhuang/hellominecraftlauncher/apis/HttpGet.html" title="org.jackhuang.hellominecraftlauncher.apis中的类" target="classFrame">HttpGet</a></li>
<li><a href="org/jackhuang/hellominecraftlauncher/download/HttpsDownloader.html" title="org.jackhuang.hellominecraftlauncher.download中的类" target="classFrame">HttpsDownloader</a></li>
<li><a href="org/jackhuang/hellominecraftlauncher/apis/handlers/IAssetsHandler.html" title="org.jackhuang.hellominecraftlauncher.apis.handlers中的类" target="classFrame">IAssetsHandler</a></li>
<li><a href="org/jackhuang/hellominecraftlauncher/apis/IMinecraftEnvironment.html" title="org.jackhuang.hellominecraftlauncher.apis中的接口" target="classFrame"><i>IMinecraftEnvironment</i></a></li>
<li><a href="org/jackhuang/hellominecraftlauncher/apis/IPlugin.html" title="org.jackhuang.hellominecraftlauncher.apis中的类" target="classFrame">IPlugin</a></li>
<li><a href="org/jackhuang/hellominecraftlauncher/apis/IPluginHandler.html" title="org.jackhuang.hellominecraftlauncher.apis中的接口" target="classFrame"><i>IPluginHandler</i></a></li>
<li><a href="org/jackhuang/hellominecraftlauncher/apis/IPluginRegister.html" title="org.jackhuang.hellominecraftlauncher.apis中的接口" target="classFrame"><i>IPluginRegister</i></a></li>
<li><a href="org/jackhuang/hellominecraftlauncher/apis/handlers/Login.html" title="org.jackhuang.hellominecraftlauncher.apis.handlers中的类" target="classFrame">Login</a></li>
<li><a href="org/jackhuang/hellominecraftlauncher/apis/handlers/LoginInfo.html" title="org.jackhuang.hellominecraftlauncher.apis.handlers中的类" target="classFrame">LoginInfo</a></li>
<li><a href="org/jackhuang/hellominecraftlauncher/apis/handlers/LoginResult.html" title="org.jackhuang.hellominecraftlauncher.apis.handlers中的类" target="classFrame">LoginResult</a></li>
<li><a href="org/jackhuang/hellominecraftlauncher/apis/LogUtils.html" title="org.jackhuang.hellominecraftlauncher.apis中的类" target="classFrame">LogUtils</a></li>
<li><a href="org/jackhuang/hellominecraftlauncher/apis/utils/MessageBox.html" title="org.jackhuang.hellominecraftlauncher.apis.utils中的类" target="classFrame">MessageBox</a></li>
<li><a href="org/jackhuang/hellominecraftlauncher/apis/version/MinecraftLibrary.html" title="org.jackhuang.hellominecraftlauncher.apis.version中的类" target="classFrame">MinecraftLibrary</a></li>
<li><a href="org/jackhuang/hellominecraftlauncher/apis/version/MinecraftVersion.html" title="org.jackhuang.hellominecraftlauncher.apis.version中的类" target="classFrame">MinecraftVersion</a></li>
<li><a href="org/jackhuang/hellominecraftlauncher/apis/utils/MinecraftVersionRequest.html" title="org.jackhuang.hellominecraftlauncher.apis.utils中的类" target="classFrame">MinecraftVersionRequest</a></li>
<li><a href="org/jackhuang/hellominecraftlauncher/apis/utils/ModType.html" title="org.jackhuang.hellominecraftlauncher.apis.utils中的类" target="classFrame">ModType</a></li>
<li><a href="org/jackhuang/hellominecraftlauncher/apis/version/Natives.html" title="org.jackhuang.hellominecraftlauncher.apis.version中的类" target="classFrame">Natives</a></li>
<li><a href="org/jackhuang/hellominecraftlauncher/apis/utils/OperatingSystems.html" title="org.jackhuang.hellominecraftlauncher.apis.utils中的枚举" target="classFrame">OperatingSystems</a></li>
<li><a href="org/jackhuang/hellominecraftlauncher/apis/version/OS.html" title="org.jackhuang.hellominecraftlauncher.apis.version中的类" target="classFrame">OS</a></li>
<li><a href="org/jackhuang/hellominecraftlauncher/apis/Pair.html" title="org.jackhuang.hellominecraftlauncher.apis中的类" target="classFrame">Pair</a></li>
<li><a href="org/jackhuang/hellominecraftlauncher/apis/Plugin.html" title="org.jackhuang.hellominecraftlauncher.apis中的注释" target="classFrame">Plugin</a></li>
<li><a href="org/jackhuang/hellominecraftlauncher/apis/PluginHandlerType.html" title="org.jackhuang.hellominecraftlauncher.apis中的枚举" target="classFrame">PluginHandlerType</a></li>
<li><a href="org/jackhuang/hellominecraftlauncher/apis/version/Rules.html" title="org.jackhuang.hellominecraftlauncher.apis.version中的类" target="classFrame">Rules</a></li>
<li><a href="org/jackhuang/hellominecraftlauncher/apis/Selector.html" title="org.jackhuang.hellominecraftlauncher.apis中的类" target="classFrame">Selector</a></li>
<li><a href="org/jackhuang/hellominecraftlauncher/settings/Settings.html" title="org.jackhuang.hellominecraftlauncher.settings中的类" target="classFrame">Settings</a></li>
<li><a href="org/jackhuang/hellominecraftlauncher/settings/SettingsManager.html" title="org.jackhuang.hellominecraftlauncher.settings中的类" target="classFrame">SettingsManager</a></li>
<li><a href="org/jackhuang/hellominecraftlauncher/download/URLGet.html" title="org.jackhuang.hellominecraftlauncher.download中的类" target="classFrame">URLGet</a></li>
<li><a href="org/jackhuang/hellominecraftlauncher/download/URLGetThread.html" title="org.jackhuang.hellominecraftlauncher.download中的类" target="classFrame">URLGetThread</a></li>
<li><a href="org/jackhuang/hellominecraftlauncher/apis/utils/Utils.html" title="org.jackhuang.hellominecraftlauncher.apis.utils中的类" target="classFrame">Utils</a></li>
<li><a href="org/jackhuang/hellominecraftlauncher/settings/Version.html" title="org.jackhuang.hellominecraftlauncher.settings中的类" target="classFrame">Version</a></li>
</ul>
</div>
</body>
</html>
+60
View File
@@ -0,0 +1,60 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="zh">
<head>
<!-- Generated by javadoc (version 1.7.0_15) on Wed Jan 01 21:27:29 CST 2014 -->
<meta http-equiv="Content-Type" content="text/html" charset="UTF-8">
<title>所有类</title>
<meta name="date" content="2014-01-01">
<link rel="stylesheet" type="text/css" href="stylesheet.css" title="Style">
</head>
<body>
<h1 class="bar">所有类</h1>
<div class="indexContainer">
<ul>
<li><a href="org/jackhuang/hellominecraftlauncher/apis/utils/Compressor.html" title="org.jackhuang.hellominecraftlauncher.apis.utils中的类">Compressor</a></li>
<li><a href="org/jackhuang/hellominecraftlauncher/apis/Configuration.html" title="org.jackhuang.hellominecraftlauncher.apis中的类">Configuration</a></li>
<li><a href="org/jackhuang/hellominecraftlauncher/apis/DoneListener.html" title="org.jackhuang.hellominecraftlauncher.apis中的接口"><i>DoneListener</i></a></li>
<li><a href="org/jackhuang/hellominecraftlauncher/download/DownloadAllThread.html" title="org.jackhuang.hellominecraftlauncher.download中的类">DownloadAllThread</a></li>
<li><a href="org/jackhuang/hellominecraftlauncher/download/DownloadListener.html" title="org.jackhuang.hellominecraftlauncher.download中的接口"><i>DownloadListener</i></a></li>
<li><a href="org/jackhuang/hellominecraftlauncher/download/DownloadType.html" title="org.jackhuang.hellominecraftlauncher.download中的枚举">DownloadType</a></li>
<li><a href="org/jackhuang/hellominecraftlauncher/download/DownloadUtils.html" title="org.jackhuang.hellominecraftlauncher.download中的类">DownloadUtils</a></li>
<li><a href="org/jackhuang/hellominecraftlauncher/apis/utils/FolderOpener.html" title="org.jackhuang.hellominecraftlauncher.apis.utils中的类">FolderOpener</a></li>
<li><a href="org/jackhuang/hellominecraftlauncher/apis/events/HMCLPluginLoadEvent.html" title="org.jackhuang.hellominecraftlauncher.apis.events中的类">HMCLPluginLoadEvent</a></li>
<li><a href="org/jackhuang/hellominecraftlauncher/apis/events/HMCLPluginUnloadEvent.html" title="org.jackhuang.hellominecraftlauncher.apis.events中的类">HMCLPluginUnloadEvent</a></li>
<li><a href="org/jackhuang/hellominecraftlauncher/apis/events/HMCLPluginVersionChangedEvent.html" title="org.jackhuang.hellominecraftlauncher.apis.events中的类">HMCLPluginVersionChangedEvent</a></li>
<li><a href="org/jackhuang/hellominecraftlauncher/download/HttpDownloader.html" title="org.jackhuang.hellominecraftlauncher.download中的类">HttpDownloader</a></li>
<li><a href="org/jackhuang/hellominecraftlauncher/apis/HttpGet.html" title="org.jackhuang.hellominecraftlauncher.apis中的类">HttpGet</a></li>
<li><a href="org/jackhuang/hellominecraftlauncher/download/HttpsDownloader.html" title="org.jackhuang.hellominecraftlauncher.download中的类">HttpsDownloader</a></li>
<li><a href="org/jackhuang/hellominecraftlauncher/apis/handlers/IAssetsHandler.html" title="org.jackhuang.hellominecraftlauncher.apis.handlers中的类">IAssetsHandler</a></li>
<li><a href="org/jackhuang/hellominecraftlauncher/apis/IMinecraftEnvironment.html" title="org.jackhuang.hellominecraftlauncher.apis中的接口"><i>IMinecraftEnvironment</i></a></li>
<li><a href="org/jackhuang/hellominecraftlauncher/apis/IPlugin.html" title="org.jackhuang.hellominecraftlauncher.apis中的类">IPlugin</a></li>
<li><a href="org/jackhuang/hellominecraftlauncher/apis/IPluginHandler.html" title="org.jackhuang.hellominecraftlauncher.apis中的接口"><i>IPluginHandler</i></a></li>
<li><a href="org/jackhuang/hellominecraftlauncher/apis/IPluginRegister.html" title="org.jackhuang.hellominecraftlauncher.apis中的接口"><i>IPluginRegister</i></a></li>
<li><a href="org/jackhuang/hellominecraftlauncher/apis/handlers/Login.html" title="org.jackhuang.hellominecraftlauncher.apis.handlers中的类">Login</a></li>
<li><a href="org/jackhuang/hellominecraftlauncher/apis/handlers/LoginInfo.html" title="org.jackhuang.hellominecraftlauncher.apis.handlers中的类">LoginInfo</a></li>
<li><a href="org/jackhuang/hellominecraftlauncher/apis/handlers/LoginResult.html" title="org.jackhuang.hellominecraftlauncher.apis.handlers中的类">LoginResult</a></li>
<li><a href="org/jackhuang/hellominecraftlauncher/apis/LogUtils.html" title="org.jackhuang.hellominecraftlauncher.apis中的类">LogUtils</a></li>
<li><a href="org/jackhuang/hellominecraftlauncher/apis/utils/MessageBox.html" title="org.jackhuang.hellominecraftlauncher.apis.utils中的类">MessageBox</a></li>
<li><a href="org/jackhuang/hellominecraftlauncher/apis/version/MinecraftLibrary.html" title="org.jackhuang.hellominecraftlauncher.apis.version中的类">MinecraftLibrary</a></li>
<li><a href="org/jackhuang/hellominecraftlauncher/apis/version/MinecraftVersion.html" title="org.jackhuang.hellominecraftlauncher.apis.version中的类">MinecraftVersion</a></li>
<li><a href="org/jackhuang/hellominecraftlauncher/apis/utils/MinecraftVersionRequest.html" title="org.jackhuang.hellominecraftlauncher.apis.utils中的类">MinecraftVersionRequest</a></li>
<li><a href="org/jackhuang/hellominecraftlauncher/apis/utils/ModType.html" title="org.jackhuang.hellominecraftlauncher.apis.utils中的类">ModType</a></li>
<li><a href="org/jackhuang/hellominecraftlauncher/apis/version/Natives.html" title="org.jackhuang.hellominecraftlauncher.apis.version中的类">Natives</a></li>
<li><a href="org/jackhuang/hellominecraftlauncher/apis/utils/OperatingSystems.html" title="org.jackhuang.hellominecraftlauncher.apis.utils中的枚举">OperatingSystems</a></li>
<li><a href="org/jackhuang/hellominecraftlauncher/apis/version/OS.html" title="org.jackhuang.hellominecraftlauncher.apis.version中的类">OS</a></li>
<li><a href="org/jackhuang/hellominecraftlauncher/apis/Pair.html" title="org.jackhuang.hellominecraftlauncher.apis中的类">Pair</a></li>
<li><a href="org/jackhuang/hellominecraftlauncher/apis/Plugin.html" title="org.jackhuang.hellominecraftlauncher.apis中的注释">Plugin</a></li>
<li><a href="org/jackhuang/hellominecraftlauncher/apis/PluginHandlerType.html" title="org.jackhuang.hellominecraftlauncher.apis中的枚举">PluginHandlerType</a></li>
<li><a href="org/jackhuang/hellominecraftlauncher/apis/version/Rules.html" title="org.jackhuang.hellominecraftlauncher.apis.version中的类">Rules</a></li>
<li><a href="org/jackhuang/hellominecraftlauncher/apis/Selector.html" title="org.jackhuang.hellominecraftlauncher.apis中的类">Selector</a></li>
<li><a href="org/jackhuang/hellominecraftlauncher/settings/Settings.html" title="org.jackhuang.hellominecraftlauncher.settings中的类">Settings</a></li>
<li><a href="org/jackhuang/hellominecraftlauncher/settings/SettingsManager.html" title="org.jackhuang.hellominecraftlauncher.settings中的类">SettingsManager</a></li>
<li><a href="org/jackhuang/hellominecraftlauncher/download/URLGet.html" title="org.jackhuang.hellominecraftlauncher.download中的类">URLGet</a></li>
<li><a href="org/jackhuang/hellominecraftlauncher/download/URLGetThread.html" title="org.jackhuang.hellominecraftlauncher.download中的类">URLGetThread</a></li>
<li><a href="org/jackhuang/hellominecraftlauncher/apis/utils/Utils.html" title="org.jackhuang.hellominecraftlauncher.apis.utils中的类">Utils</a></li>
<li><a href="org/jackhuang/hellominecraftlauncher/settings/Version.html" title="org.jackhuang.hellominecraftlauncher.settings中的类">Version</a></li>
</ul>
</div>
</body>
</html>
+400
View File
@@ -0,0 +1,400 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="zh">
<head>
<!-- Generated by javadoc (version 1.7.0_15) on Wed Jan 01 21:27:28 CST 2014 -->
<meta http-equiv="Content-Type" content="text/html" charset="UTF-8">
<title>常量字段值</title>
<meta name="date" content="2014-01-01">
<link rel="stylesheet" type="text/css" href="stylesheet.css" title="Style">
</head>
<body>
<script type="text/javascript"><!--
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="常量字段值";
}
//-->
</script>
<noscript>
<div>您的浏览器已禁用 JavaScript。</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar_top">
<!-- -->
</a><a href="#skip-navbar_top" title="跳过导航链接"></a><a name="navbar_top_firstrow">
<!-- -->
</a>
<ul class="navList" title="导航">
<li><a href="overview-summary.html">概览</a></li>
<li>程序包</li>
<li>类</li>
<li>使用</li>
<li><a href="overview-tree.html">树</a></li>
<li><a href="deprecated-list.html">已过时</a></li>
<li><a href="index-files/index-1.html">索引</a></li>
<li><a href="help-doc.html">帮助</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li>上一个</li>
<li>下一个</li>
</ul>
<ul class="navList">
<li><a href="index.html?constant-values.html" target="_top">框架</a></li>
<li><a href="constant-values.html" target="_top">无框架</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="allclasses-noframe.html">所有类</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_top");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<a name="skip-navbar_top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<div class="header">
<h1 title="常量字段值" class="title">常量字段值</h1>
<h2 title="目录">目录</h2>
<ul>
<li><a href="#org.jackhuang">org.jackhuang.*</a></li>
</ul>
</div>
<div class="constantValuesContainer"><a name="org.jackhuang">
<!-- -->
</a>
<h2 title="org.jackhuang">org.jackhuang.*</h2>
<ul class="blockList">
<li class="blockList">
<table border="0" cellpadding="3" cellspacing="0" summary="常量字段值表, 列表常量字段和值">
<caption><span>org.jackhuang.hellominecraftlauncher.apis.utils.<a href="org/jackhuang/hellominecraftlauncher/apis/utils/MessageBox.html" title="org.jackhuang.hellominecraftlauncher.apis.utils中的类">MessageBox</a></span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colFirst" scope="col">限定符和类型</th>
<th scope="col">常量字段</th>
<th class="colLast" scope="col">值</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colFirst"><a name="org.jackhuang.hellominecraftlauncher.apis.utils.MessageBox.CANCEL_OPTION">
<!-- -->
</a><code>public&nbsp;static&nbsp;final&nbsp;int</code></td>
<td><code><a href="org/jackhuang/hellominecraftlauncher/apis/utils/MessageBox.html#CANCEL_OPTION">CANCEL_OPTION</a></code></td>
<td class="colLast"><code>2</code></td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a name="org.jackhuang.hellominecraftlauncher.apis.utils.MessageBox.CLOSED_OPTION">
<!-- -->
</a><code>public&nbsp;static&nbsp;final&nbsp;int</code></td>
<td><code><a href="org/jackhuang/hellominecraftlauncher/apis/utils/MessageBox.html#CLOSED_OPTION">CLOSED_OPTION</a></code></td>
<td class="colLast"><code>-1</code></td>
</tr>
<tr class="altColor">
<td class="colFirst"><a name="org.jackhuang.hellominecraftlauncher.apis.utils.MessageBox.DEFAULT_OPTION">
<!-- -->
</a><code>public&nbsp;static&nbsp;final&nbsp;int</code></td>
<td><code><a href="org/jackhuang/hellominecraftlauncher/apis/utils/MessageBox.html#DEFAULT_OPTION">DEFAULT_OPTION</a></code></td>
<td class="colLast"><code>-1</code></td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a name="org.jackhuang.hellominecraftlauncher.apis.utils.MessageBox.ERROR_MESSAGE">
<!-- -->
</a><code>public&nbsp;static&nbsp;final&nbsp;int</code></td>
<td><code><a href="org/jackhuang/hellominecraftlauncher/apis/utils/MessageBox.html#ERROR_MESSAGE">ERROR_MESSAGE</a></code></td>
<td class="colLast"><code>0</code></td>
</tr>
<tr class="altColor">
<td class="colFirst"><a name="org.jackhuang.hellominecraftlauncher.apis.utils.MessageBox.INFORMATION_MESSAGE">
<!-- -->
</a><code>public&nbsp;static&nbsp;final&nbsp;int</code></td>
<td><code><a href="org/jackhuang/hellominecraftlauncher/apis/utils/MessageBox.html#INFORMATION_MESSAGE">INFORMATION_MESSAGE</a></code></td>
<td class="colLast"><code>1</code></td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a name="org.jackhuang.hellominecraftlauncher.apis.utils.MessageBox.NO_OPTION">
<!-- -->
</a><code>public&nbsp;static&nbsp;final&nbsp;int</code></td>
<td><code><a href="org/jackhuang/hellominecraftlauncher/apis/utils/MessageBox.html#NO_OPTION">NO_OPTION</a></code></td>
<td class="colLast"><code>1</code></td>
</tr>
<tr class="altColor">
<td class="colFirst"><a name="org.jackhuang.hellominecraftlauncher.apis.utils.MessageBox.OK_CANCEL_OPTION">
<!-- -->
</a><code>public&nbsp;static&nbsp;final&nbsp;int</code></td>
<td><code><a href="org/jackhuang/hellominecraftlauncher/apis/utils/MessageBox.html#OK_CANCEL_OPTION">OK_CANCEL_OPTION</a></code></td>
<td class="colLast"><code>12</code></td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a name="org.jackhuang.hellominecraftlauncher.apis.utils.MessageBox.OK_OPTION">
<!-- -->
</a><code>public&nbsp;static&nbsp;final&nbsp;int</code></td>
<td><code><a href="org/jackhuang/hellominecraftlauncher/apis/utils/MessageBox.html#OK_OPTION">OK_OPTION</a></code></td>
<td class="colLast"><code>0</code></td>
</tr>
<tr class="altColor">
<td class="colFirst"><a name="org.jackhuang.hellominecraftlauncher.apis.utils.MessageBox.PLAIN_MESSAGE">
<!-- -->
</a><code>public&nbsp;static&nbsp;final&nbsp;int</code></td>
<td><code><a href="org/jackhuang/hellominecraftlauncher/apis/utils/MessageBox.html#PLAIN_MESSAGE">PLAIN_MESSAGE</a></code></td>
<td class="colLast"><code>-1</code></td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a name="org.jackhuang.hellominecraftlauncher.apis.utils.MessageBox.QUESTION_MESSAGE">
<!-- -->
</a><code>public&nbsp;static&nbsp;final&nbsp;int</code></td>
<td><code><a href="org/jackhuang/hellominecraftlauncher/apis/utils/MessageBox.html#QUESTION_MESSAGE">QUESTION_MESSAGE</a></code></td>
<td class="colLast"><code>3</code></td>
</tr>
<tr class="altColor">
<td class="colFirst"><a name="org.jackhuang.hellominecraftlauncher.apis.utils.MessageBox.WARNING_MESSAGE">
<!-- -->
</a><code>public&nbsp;static&nbsp;final&nbsp;int</code></td>
<td><code><a href="org/jackhuang/hellominecraftlauncher/apis/utils/MessageBox.html#WARNING_MESSAGE">WARNING_MESSAGE</a></code></td>
<td class="colLast"><code>2</code></td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a name="org.jackhuang.hellominecraftlauncher.apis.utils.MessageBox.YES_NO_CANCEL_OPTION">
<!-- -->
</a><code>public&nbsp;static&nbsp;final&nbsp;int</code></td>
<td><code><a href="org/jackhuang/hellominecraftlauncher/apis/utils/MessageBox.html#YES_NO_CANCEL_OPTION">YES_NO_CANCEL_OPTION</a></code></td>
<td class="colLast"><code>11</code></td>
</tr>
<tr class="altColor">
<td class="colFirst"><a name="org.jackhuang.hellominecraftlauncher.apis.utils.MessageBox.YES_NO_OPTION">
<!-- -->
</a><code>public&nbsp;static&nbsp;final&nbsp;int</code></td>
<td><code><a href="org/jackhuang/hellominecraftlauncher/apis/utils/MessageBox.html#YES_NO_OPTION">YES_NO_OPTION</a></code></td>
<td class="colLast"><code>10</code></td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a name="org.jackhuang.hellominecraftlauncher.apis.utils.MessageBox.YES_OPTION">
<!-- -->
</a><code>public&nbsp;static&nbsp;final&nbsp;int</code></td>
<td><code><a href="org/jackhuang/hellominecraftlauncher/apis/utils/MessageBox.html#YES_OPTION">YES_OPTION</a></code></td>
<td class="colLast"><code>0</code></td>
</tr>
</tbody>
</table>
</li>
<li class="blockList">
<table border="0" cellpadding="3" cellspacing="0" summary="常量字段值表, 列表常量字段和值">
<caption><span>org.jackhuang.hellominecraftlauncher.apis.utils.<a href="org/jackhuang/hellominecraftlauncher/apis/utils/MinecraftVersionRequest.html" title="org.jackhuang.hellominecraftlauncher.apis.utils中的类">MinecraftVersionRequest</a></span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colFirst" scope="col">限定符和类型</th>
<th scope="col">常量字段</th>
<th class="colLast" scope="col">值</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colFirst"><a name="org.jackhuang.hellominecraftlauncher.apis.utils.MinecraftVersionRequest.Invaild">
<!-- -->
</a><code>public&nbsp;static&nbsp;final&nbsp;int</code></td>
<td><code><a href="org/jackhuang/hellominecraftlauncher/apis/utils/MinecraftVersionRequest.html#Invaild">Invaild</a></code></td>
<td class="colLast"><code>1</code></td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a name="org.jackhuang.hellominecraftlauncher.apis.utils.MinecraftVersionRequest.InvaildJar">
<!-- -->
</a><code>public&nbsp;static&nbsp;final&nbsp;int</code></td>
<td><code><a href="org/jackhuang/hellominecraftlauncher/apis/utils/MinecraftVersionRequest.html#InvaildJar">InvaildJar</a></code></td>
<td class="colLast"><code>2</code></td>
</tr>
<tr class="altColor">
<td class="colFirst"><a name="org.jackhuang.hellominecraftlauncher.apis.utils.MinecraftVersionRequest.Modified">
<!-- -->
</a><code>public&nbsp;static&nbsp;final&nbsp;int</code></td>
<td><code><a href="org/jackhuang/hellominecraftlauncher/apis/utils/MinecraftVersionRequest.html#Modified">Modified</a></code></td>
<td class="colLast"><code>3</code></td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a name="org.jackhuang.hellominecraftlauncher.apis.utils.MinecraftVersionRequest.NotAFile">
<!-- -->
</a><code>public&nbsp;static&nbsp;final&nbsp;int</code></td>
<td><code><a href="org/jackhuang/hellominecraftlauncher/apis/utils/MinecraftVersionRequest.html#NotAFile">NotAFile</a></code></td>
<td class="colLast"><code>7</code></td>
</tr>
<tr class="altColor">
<td class="colFirst"><a name="org.jackhuang.hellominecraftlauncher.apis.utils.MinecraftVersionRequest.NotFound">
<!-- -->
</a><code>public&nbsp;static&nbsp;final&nbsp;int</code></td>
<td><code><a href="org/jackhuang/hellominecraftlauncher/apis/utils/MinecraftVersionRequest.html#NotFound">NotFound</a></code></td>
<td class="colLast"><code>5</code></td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a name="org.jackhuang.hellominecraftlauncher.apis.utils.MinecraftVersionRequest.NotReadable">
<!-- -->
</a><code>public&nbsp;static&nbsp;final&nbsp;int</code></td>
<td><code><a href="org/jackhuang/hellominecraftlauncher/apis/utils/MinecraftVersionRequest.html#NotReadable">NotReadable</a></code></td>
<td class="colLast"><code>6</code></td>
</tr>
<tr class="altColor">
<td class="colFirst"><a name="org.jackhuang.hellominecraftlauncher.apis.utils.MinecraftVersionRequest.OK">
<!-- -->
</a><code>public&nbsp;static&nbsp;final&nbsp;int</code></td>
<td><code><a href="org/jackhuang/hellominecraftlauncher/apis/utils/MinecraftVersionRequest.html#OK">OK</a></code></td>
<td class="colLast"><code>4</code></td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a name="org.jackhuang.hellominecraftlauncher.apis.utils.MinecraftVersionRequest.Unkown">
<!-- -->
</a><code>public&nbsp;static&nbsp;final&nbsp;int</code></td>
<td><code><a href="org/jackhuang/hellominecraftlauncher/apis/utils/MinecraftVersionRequest.html#Unkown">Unkown</a></code></td>
<td class="colLast"><code>0</code></td>
</tr>
</tbody>
</table>
</li>
<li class="blockList">
<table border="0" cellpadding="3" cellspacing="0" summary="常量字段值表, 列表常量字段和值">
<caption><span>org.jackhuang.hellominecraftlauncher.apis.utils.<a href="org/jackhuang/hellominecraftlauncher/apis/utils/ModType.html" title="org.jackhuang.hellominecraftlauncher.apis.utils中的类">ModType</a></span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colFirst" scope="col">限定符和类型</th>
<th scope="col">常量字段</th>
<th class="colLast" scope="col">值</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colFirst"><a name="org.jackhuang.hellominecraftlauncher.apis.utils.ModType.Forge">
<!-- -->
</a><code>public&nbsp;static&nbsp;final&nbsp;int</code></td>
<td><code><a href="org/jackhuang/hellominecraftlauncher/apis/utils/ModType.html#Forge">Forge</a></code></td>
<td class="colLast"><code>2</code></td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a name="org.jackhuang.hellominecraftlauncher.apis.utils.ModType.ForgeMod">
<!-- -->
</a><code>public&nbsp;static&nbsp;final&nbsp;int</code></td>
<td><code><a href="org/jackhuang/hellominecraftlauncher/apis/utils/ModType.html#ForgeMod">ForgeMod</a></code></td>
<td class="colLast"><code>0</code></td>
</tr>
<tr class="altColor">
<td class="colFirst"><a name="org.jackhuang.hellominecraftlauncher.apis.utils.ModType.ModLoader">
<!-- -->
</a><code>public&nbsp;static&nbsp;final&nbsp;int</code></td>
<td><code><a href="org/jackhuang/hellominecraftlauncher/apis/utils/ModType.html#ModLoader">ModLoader</a></code></td>
<td class="colLast"><code>3</code></td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a name="org.jackhuang.hellominecraftlauncher.apis.utils.ModType.ModLoaderMod">
<!-- -->
</a><code>public&nbsp;static&nbsp;final&nbsp;int</code></td>
<td><code><a href="org/jackhuang/hellominecraftlauncher/apis/utils/ModType.html#ModLoaderMod">ModLoaderMod</a></code></td>
<td class="colLast"><code>1</code></td>
</tr>
<tr class="altColor">
<td class="colFirst"><a name="org.jackhuang.hellominecraftlauncher.apis.utils.ModType.Unknown">
<!-- -->
</a><code>public&nbsp;static&nbsp;final&nbsp;int</code></td>
<td><code><a href="org/jackhuang/hellominecraftlauncher/apis/utils/ModType.html#Unknown">Unknown</a></code></td>
<td class="colLast"><code>4</code></td>
</tr>
</tbody>
</table>
</li>
</ul>
<ul class="blockList">
<li class="blockList">
<table border="0" cellpadding="3" cellspacing="0" summary="常量字段值表, 列表常量字段和值">
<caption><span>org.jackhuang.hellominecraftlauncher.download.<a href="org/jackhuang/hellominecraftlauncher/download/HttpDownloader.html" title="org.jackhuang.hellominecraftlauncher.download中的类">HttpDownloader</a></span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colFirst" scope="col">限定符和类型</th>
<th scope="col">常量字段</th>
<th class="colLast" scope="col">值</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colFirst"><a name="org.jackhuang.hellominecraftlauncher.download.HttpDownloader.CANCELLED">
<!-- -->
</a><code>public&nbsp;static&nbsp;final&nbsp;int</code></td>
<td><code><a href="org/jackhuang/hellominecraftlauncher/download/HttpDownloader.html#CANCELLED">CANCELLED</a></code></td>
<td class="colLast"><code>3</code></td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a name="org.jackhuang.hellominecraftlauncher.download.HttpDownloader.COMPLETE">
<!-- -->
</a><code>public&nbsp;static&nbsp;final&nbsp;int</code></td>
<td><code><a href="org/jackhuang/hellominecraftlauncher/download/HttpDownloader.html#COMPLETE">COMPLETE</a></code></td>
<td class="colLast"><code>2</code></td>
</tr>
<tr class="altColor">
<td class="colFirst"><a name="org.jackhuang.hellominecraftlauncher.download.HttpDownloader.DOWNLOADING">
<!-- -->
</a><code>public&nbsp;static&nbsp;final&nbsp;int</code></td>
<td><code><a href="org/jackhuang/hellominecraftlauncher/download/HttpDownloader.html#DOWNLOADING">DOWNLOADING</a></code></td>
<td class="colLast"><code>0</code></td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a name="org.jackhuang.hellominecraftlauncher.download.HttpDownloader.ERROR">
<!-- -->
</a><code>public&nbsp;static&nbsp;final&nbsp;int</code></td>
<td><code><a href="org/jackhuang/hellominecraftlauncher/download/HttpDownloader.html#ERROR">ERROR</a></code></td>
<td class="colLast"><code>4</code></td>
</tr>
<tr class="altColor">
<td class="colFirst"><a name="org.jackhuang.hellominecraftlauncher.download.HttpDownloader.PAUSED">
<!-- -->
</a><code>public&nbsp;static&nbsp;final&nbsp;int</code></td>
<td><code><a href="org/jackhuang/hellominecraftlauncher/download/HttpDownloader.html#PAUSED">PAUSED</a></code></td>
<td class="colLast"><code>1</code></td>
</tr>
</tbody>
</table>
</li>
</ul>
</div>
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar_bottom">
<!-- -->
</a><a href="#skip-navbar_bottom" title="跳过导航链接"></a><a name="navbar_bottom_firstrow">
<!-- -->
</a>
<ul class="navList" title="导航">
<li><a href="overview-summary.html">概览</a></li>
<li>程序包</li>
<li>类</li>
<li>使用</li>
<li><a href="overview-tree.html">树</a></li>
<li><a href="deprecated-list.html">已过时</a></li>
<li><a href="index-files/index-1.html">索引</a></li>
<li><a href="help-doc.html">帮助</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li>上一个</li>
<li>下一个</li>
</ul>
<ul class="navList">
<li><a href="index.html?constant-values.html" target="_top">框架</a></li>
<li><a href="constant-values.html" target="_top">无框架</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="allclasses-noframe.html">所有类</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_bottom");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<a name="skip-navbar_bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
</body>
</html>
+116
View File
@@ -0,0 +1,116 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="zh">
<head>
<!-- Generated by javadoc (version 1.7.0_15) on Wed Jan 01 21:27:29 CST 2014 -->
<meta http-equiv="Content-Type" content="text/html" charset="UTF-8">
<title>已过时的列表</title>
<meta name="date" content="2014-01-01">
<link rel="stylesheet" type="text/css" href="stylesheet.css" title="Style">
</head>
<body>
<script type="text/javascript"><!--
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="已过时的列表";
}
//-->
</script>
<noscript>
<div>您的浏览器已禁用 JavaScript。</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar_top">
<!-- -->
</a><a href="#skip-navbar_top" title="跳过导航链接"></a><a name="navbar_top_firstrow">
<!-- -->
</a>
<ul class="navList" title="导航">
<li><a href="overview-summary.html">概览</a></li>
<li>程序包</li>
<li>类</li>
<li>使用</li>
<li><a href="overview-tree.html">树</a></li>
<li class="navBarCell1Rev">已过时</li>
<li><a href="index-files/index-1.html">索引</a></li>
<li><a href="help-doc.html">帮助</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li>上一个</li>
<li>下一个</li>
</ul>
<ul class="navList">
<li><a href="index.html?deprecated-list.html" target="_top">框架</a></li>
<li><a href="deprecated-list.html" target="_top">无框架</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="allclasses-noframe.html">所有类</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_top");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<a name="skip-navbar_top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<div class="header">
<h1 title="已过时的 API" class="title">已过时的 API</h1>
<h2 title="目录">目录</h2>
</div>
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar_bottom">
<!-- -->
</a><a href="#skip-navbar_bottom" title="跳过导航链接"></a><a name="navbar_bottom_firstrow">
<!-- -->
</a>
<ul class="navList" title="导航">
<li><a href="overview-summary.html">概览</a></li>
<li>程序包</li>
<li>类</li>
<li>使用</li>
<li><a href="overview-tree.html">树</a></li>
<li class="navBarCell1Rev">已过时</li>
<li><a href="index-files/index-1.html">索引</a></li>
<li><a href="help-doc.html">帮助</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li>上一个</li>
<li>下一个</li>
</ul>
<ul class="navList">
<li><a href="index.html?deprecated-list.html" target="_top">框架</a></li>
<li><a href="deprecated-list.html" target="_top">无框架</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="allclasses-noframe.html">所有类</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_bottom");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<a name="skip-navbar_bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
</body>
</html>
+221
View File
@@ -0,0 +1,221 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="zh">
<head>
<!-- Generated by javadoc (version 1.7.0_15) on Wed Jan 01 21:27:29 CST 2014 -->
<meta http-equiv="Content-Type" content="text/html" charset="UTF-8">
<title>API 帮助</title>
<meta name="date" content="2014-01-01">
<link rel="stylesheet" type="text/css" href="stylesheet.css" title="Style">
</head>
<body>
<script type="text/javascript"><!--
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="API 帮助";
}
//-->
</script>
<noscript>
<div>您的浏览器已禁用 JavaScript。</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar_top">
<!-- -->
</a><a href="#skip-navbar_top" title="跳过导航链接"></a><a name="navbar_top_firstrow">
<!-- -->
</a>
<ul class="navList" title="导航">
<li><a href="overview-summary.html">概览</a></li>
<li>程序包</li>
<li>类</li>
<li>使用</li>
<li><a href="overview-tree.html">树</a></li>
<li><a href="deprecated-list.html">已过时</a></li>
<li><a href="index-files/index-1.html">索引</a></li>
<li class="navBarCell1Rev">帮助</li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li>上一个</li>
<li>下一个</li>
</ul>
<ul class="navList">
<li><a href="index.html?help-doc.html" target="_top">框架</a></li>
<li><a href="help-doc.html" target="_top">无框架</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="allclasses-noframe.html">所有类</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_top");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<a name="skip-navbar_top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<div class="header">
<h1 class="title">此 API 文档的组织方式</h1>
<div class="subTitle">此 API (应用程序编程接口) 文档包含对应于导航栏中的项目的页面, 如下所述。</div>
</div>
<div class="contentContainer">
<ul class="blockList">
<li class="blockList">
<h2>概览</h2>
<p><a href="overview-summary.html">概览</a> 页面是此 API 文档的首页, 提供了所有程序包的列表及其概要。此页面也可能包含这些程序包的总体说明。</p>
</li>
<li class="blockList">
<h2>程序包</h2>
<p>每个程序包都有一个页面, 其中包含它的类和接口的列表及其概要。此页面可以包含六个类别:</p>
<ul>
<li>接口 (斜体)</li>
<li>类</li>
<li>枚举</li>
<li>异常错误</li>
<li>错误</li>
<li>注释类型</li>
</ul>
</li>
<li class="blockList">
<h2>类/接口</h2>
<p>每个类, 接口, 嵌套类和嵌套接口都有各自的页面。其中每个页面都由三部分 (类/接口说明, 概要表, 以及详细的成员说明) 组成:</p>
<ul>
<li>类继承图</li>
<li>直接子类</li>
<li>所有已知子接口</li>
<li>所有已知实现类</li>
<li>类/接口声明</li>
<li>类/接口说明</li>
</ul>
<ul>
<li>嵌套类概要</li>
<li>字段概要</li>
<li>构造器概要</li>
<li>方法概要</li>
</ul>
<ul>
<li>字段详细资料</li>
<li>构造器详细资料</li>
<li>方法详细资料</li>
</ul>
<p>每个概要条目都包含该项目的详细说明的第一句。概要条目按字母顺序排列, 而详细说明则按其在源代码中出现的顺序排列。这样保持了程序员所建立的逻辑分组。</p>
</li>
<li class="blockList">
<h2>注释类型</h2>
<p>每个注释类型都有各自的页面, 其中包含以下部分:</p>
<ul>
<li>注释类型声明</li>
<li>注释类型说明</li>
<li>必需元素概要</li>
<li>可选元素概要</li>
<li>元素详细资料</li>
</ul>
</li>
<li class="blockList">
<h2>枚举</h2>
<p>每个枚举都有各自的页面, 其中包含以下部分:</p>
<ul>
<li>枚举声明</li>
<li>枚举说明</li>
<li>枚举常量概要</li>
<li>枚举常量详细资料</li>
</ul>
</li>
<li class="blockList">
<h2>使用</h2>
<p>每个已文档化的程序包, 类和接口都有各自的“使用”页面。此页面介绍了使用给定类或程序包的任何部分的程序包, 类, 方法, 构造器和字段。对于给定的类或接口 A, 其“使用”页面包含 A 的子类, 声明为 A 的字段, 返回 A 的方法, 以及带有类型为 A 的参数的方法和构造器。访问此页面的方法是: 首先转至程序包, 类或接口, 然后单击导航栏中的 "使用" 链接。</p>
</li>
<li class="blockList">
<h2>树 (类分层结构)</h2>
<p>对于所有程序包, 有一个 <a href="overview-tree.html">类分层结构</a> 页面, 以及每个程序包的分层结构。每个分层结构页面都包含类的列表和接口的列表。从 <code>java.lang.Object</code> 开始, 按继承结构对类进行排列。接口不从 <code>java.lang.Object</code> 继承。</p>
<ul>
<li>查看“概览”页面时, 单击 "树" 将显示所有程序包的分层结构。</li>
<li>查看特定程序包, 类或接口页面时, 单击 "树" 将仅显示该程序包的分层结构。</li>
</ul>
</li>
<li class="blockList">
<h2>已过时的 API</h2>
<p><a href="deprecated-list.html">已过时的 API</a> 页面列出了所有已过时的 API。一般由于进行了改进并且通常提供了替代的 API, 所以建议不要使用已过时的 API。在将来的实现过程中, 可能会删除已过时的 API。</p>
</li>
<li class="blockList">
<h2>索引</h2>
<p><a href="index-files/index-1.html">索引</a> 包含按字母顺序排列的所有类, 接口, 构造器, 方法和字段的列表。</p>
</li>
<li class="blockList">
<h2>上一个/下一个</h2>
<p>这些链接使您可以转至下一个或上一个类, 接口, 程序包或相关页面。</p>
</li>
<li class="blockList">
<h2>框架/无框架</h2>
<p>这些链接用于显示和隐藏 HTML 框架。所有页面均具有有框架和无框架两种显示方式。</p>
</li>
<li class="blockList">
<h2>所有类</h2>
<p><a href="allclasses-noframe.html">所有类</a>链接显示所有类和接口 (除了非静态嵌套类型)。</p>
</li>
<li class="blockList">
<h2>序列化表格</h2>
<p>每个可序列化或可外部化的类都有其序列化字段和方法的说明。此信息对重新实现者有用, 而对使用 API 的开发者则没有什么用处。尽管导航栏中没有链接, 但您可以通过下列方式获取此信息: 转至任何序列化类, 然后单击类说明的 "另请参阅" 部分中的 "序列化表格"。</p>
</li>
<li class="blockList">
<h2>常量字段值</h2>
<p><a href="constant-values.html">常量字段值</a>页面列出了静态最终字段及其值。</p>
</li>
</ul>
<em>此帮助文件适用于使用标准 doclet 生成的 API 文档。</em></div>
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar_bottom">
<!-- -->
</a><a href="#skip-navbar_bottom" title="跳过导航链接"></a><a name="navbar_bottom_firstrow">
<!-- -->
</a>
<ul class="navList" title="导航">
<li><a href="overview-summary.html">概览</a></li>
<li>程序包</li>
<li>类</li>
<li>使用</li>
<li><a href="overview-tree.html">树</a></li>
<li><a href="deprecated-list.html">已过时</a></li>
<li><a href="index-files/index-1.html">索引</a></li>
<li class="navBarCell1Rev">帮助</li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li>上一个</li>
<li>下一个</li>
</ul>
<ul class="navList">
<li><a href="index.html?help-doc.html" target="_top">框架</a></li>
<li><a href="help-doc.html" target="_top">无框架</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="allclasses-noframe.html">所有类</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_bottom");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<a name="skip-navbar_bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
</body>
</html>
Loaded 100 of 317 files, more files were not shown because too many files have changed in this diff. Show more