Compare commits

...
18 Commits
Author SHA1 Message Date
huangyuhui 2eaf32b23d Fixed BMCLAPI 2016-03-06 14:45:42 +08:00
huangyuhui 5899c73ab8 Should fixed #46 2016-03-05 21:43:54 +08:00
huangyuhui 6c0a446692 Fixed: Cannot cancel modpack installing 2016-03-05 14:31:32 +08:00
huangyuhui 7c2cfc171e Switch to CountDownLatch 2016-03-05 13:23:16 +08:00
huangyuhui 5d4a3c1df6 Fixed null when invoking some server commands 2016-03-04 20:18:25 +08:00
huangyuhui 587df1f5bb Fixed #45 2016-03-04 19:30:58 +08:00
huangyuhui 019fcf314b Added wrapper launcher 2016-03-04 14:06:11 +08:00
huangyuhui 1818b3575c Fixed infinite-recursion 2016-03-04 12:59:37 +08:00
huangyuhui afde41135a Fixed #42 2016-03-03 20:26:04 +08:00
huangyuhui 5dc812072f Fixed NullPointerException when only hidden version here 2016-03-01 12:40:25 +08:00
huangyuhui 3ba75d2de3 Fixed #39 2016-03-01 12:37:12 +08:00
huangyuhui dfc6e91321 Adds some suggested files to remove 2016-02-28 14:47:31 +08:00
huangyuhui a5504a4b74 Added font anti-aliasing 2016-02-28 13:49:22 +08:00
huangyuhui d10a7fad20 Fixed #38 2016-02-28 13:43:03 +08:00
huangyuhui f811d4c89f Adds some localization items 2016-02-27 17:08:29 +08:00
huangyuhui dcaa6241ec Testtest 2016-02-27 14:14:23 +08:00
huangyuhui 9527783cdb Fixed #31 2016-02-26 23:59:36 +08:00
huangyuhui db2b0cb159 Fixed #36 2016-02-26 23:42:45 +08:00
63 changed files with 754 additions and 691 deletions

No files matched your search

+13 -2
View File
@@ -1,15 +1,26 @@
language: java
jdk:
- oraclejdk8
branches:
only:
- master
before_deploy:
- git config --global user.email ${GITHUB_EMAIL}
- git config --global user.name ${GITHUB_NAME}
- git tag ${TRAVIS_BUILD_NUMBER}
- git push -q ${REPO} --tags
deploy:
provider: releases
api_key:
secure: lfFEwKtij/s9Ao/SKL7oVdsWcfASshZuwT27gllMrTx1ZQqLCG2I5mGJOp5ukx7lb3y4Tu316nFasLjy9NI3eLXSx9f0w4q+wMf0K5Yj9iOwu/TIn7JkLyHDMQ20qRwGxZplS2WUb669gIRg+l6jUHeTBW+dlTxr0mMa6WHIl8UDpHwfFrGC3i6dL4y6WlDwGl2rYktvOoA/iqvtglBcHuXaL2sDfhp5MXRcYULTIw+b9zmiQXP665DQN+Su5I3gwB4y5X8RH72GAacZn13fEIo5i8UUoHM7UQxM8y8DKSO3avyFCfpUle9+9sErQVW7b6JV1c+AoLWuAhNJLMlUTKarZE7UMqfjvoQHxX5hp2B2WHLEON/UJiGf25HJWx6VhJitE0/odujqnG/umesqki2jMTs6gPcxbc9iBjzUg+ZmFztdtC+Emnni7lpqVVl+Y5hsJRn3Z6rIiNgwmaE0r2OQgAm1vRYFc7jvOdRfyFG+uCRZF6nS56BzJ7dLc0WW8dTgSft6YFll4ZYL6hiI9qiIaBAK948y5HV+6VBWuO3xf/G2CUFbE1Y9qUCjToh3ahxNDzZvXB+rXqvlvNQOi5l8n594oQ61n45qIHSKlMBn9Bxhw29oWT5mo1aYIaNXbpzKam2w4mK0T3VrgTszu/3282wRbNr+VAwdGMfwW1s=
file:
- HMCL/build/libs/HMCL-2.4.0.233.jar
- HMCL/build/libs/HMCL-2.4.0.233.exe
- HMCL/build/libs/HMCL-${HMCL_VERSION_ROOT}.${TRAVIS_BUILD_NUMBER}.jar
- HMCL/build/libs/HMCL-${HMCL_VERSION_ROOT}.${TRAVIS_BUILD_NUMBER}.exe
- HMCSM/build/libs/HMCSM-${HMCSM_VERSION_ROOT}.${TRAVIS_BUILD_NUMBER}.jar
- HMCSM/build/libs/HMCSM-${HMCSM_VERSION_ROOT}.${TRAVIS_BUILD_NUMBER}.exe
on:
repo: huanghongxun/HMCL
tags: false
skip_cleanup: true
install: echo "skip 'gradle assemble' step"
script: gradle build --continue
+10 -2
View File
@@ -26,10 +26,18 @@ if (!hasProperty('mainClass')) {
ext.mainClass = 'org.jackhuang.hellominecraft.launcher.Main'
}
def buildnumber = System.getenv("BUILD_NUMBER") == null ? ".233" : "."+System.getenv("BUILD_NUMBER")
def buildnumber = System.getenv("TRAVIS_BUILD_NUMBER")
if (buildnumber == null)
buildnumber = System.getenv("BUILD_NUMBER")
if (buildnumber == null)
buildnumber = "233"
def versionroot = System.getenv("VERSION_ROOT")
if (versionroot == null)
versionroot = "2.4.1"
String mavenGroupId = 'HMCL'
String mavenVersion = '2.4.0' + buildnumber
String mavenVersion = versionroot + '.' + buildnumber
String bundleName = "Hello Minecraft! Launcher"
group = mavenGroupId
@@ -1,129 +0,0 @@
/*
* Hello Minecraft! Launcher.
* Copyright (C) 2013 huangyuhui <huanghongxun2008@126.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see {http://www.gnu.org/licenses/}.
*/
package org.jackhuang.hellominecraft.launcher;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.lang.reflect.Method;
import java.net.URL;
import java.net.URLClassLoader;
import java.util.ArrayList;
import java.util.logging.Level;
import java.util.logging.Logger;
import org.jackhuang.hellominecraft.util.C;
import org.jackhuang.hellominecraft.util.StrUtils;
import org.jackhuang.hellominecraft.launcher.util.MinecraftCrashAdvicer;
import org.jackhuang.hellominecraft.util.DoubleOutputStream;
import org.jackhuang.hellominecraft.util.LauncherPrintStream;
import org.jackhuang.hellominecraft.util.Utils;
/**
*
* @author huangyuhui
*/
public final class Launcher {
static final Logger LOGGER = Logger.getLogger(Launcher.class.getName());
static String classPath = "";
public static void main(String[] args) {
LOGGER.log(Level.INFO, "*** {0} ***", Main.makeTitle());
boolean showInfo = false;
String mainClass = "net.minecraft.client.Minecraft";
ArrayList<String> cmdList = new ArrayList<>();
for (String s : args)
if (s.startsWith("-cp="))
classPath = classPath.concat(s.substring("-cp=".length()));
else if (s.startsWith("-mainClass="))
mainClass = s.substring("-mainClass=".length());
else if (s.equals("-debug"))
showInfo = true;
else
cmdList.add(s);
String[] tokenized = StrUtils.tokenize(classPath, File.pathSeparator);
int len = tokenized.length;
if (showInfo) {
try {
File logFile = new File("hmclmc.log");
if (!logFile.exists() && !logFile.createNewFile())
LOGGER.info("Failed to create log file");
else {
FileOutputStream tc = new FileOutputStream(logFile);
DoubleOutputStream out = new DoubleOutputStream(tc, System.out);
System.setOut(new LauncherPrintStream(out));
DoubleOutputStream err = new DoubleOutputStream(tc, System.err);
System.setErr(new LauncherPrintStream(err));
}
} catch (IOException e) {
LOGGER.log(Level.SEVERE, "Failed to add log file appender.", e);
}
LOGGER.log(Level.INFO, "Arguments: '{'\n{0}\n'}'", StrUtils.parseParams(" ", args, "\n"));
LOGGER.log(Level.INFO, "Main Class: {0}", mainClass);
LOGGER.log(Level.INFO, "Class Path: '{'\n{0}\n'}'", StrUtils.parseParams(" ", tokenized, "\n"));
}
URL[] urls = new URL[len];
try {
for (int j = 0; j < len; j++)
urls[j] = new File(tokenized[j]).toURI().toURL();
} catch (Throwable e) {
LOGGER.log(Level.SEVERE, "Failed to get classpath.", e);
return;
}
Method minecraftMain;
URLClassLoader ucl = new URLClassLoader(urls, URLClassLoader.getSystemClassLoader().getParent());
Thread.currentThread().setContextClassLoader(ucl);
try {
minecraftMain = ucl.loadClass(mainClass).getMethod("main", String[].class);
} catch (ClassNotFoundException | NoSuchMethodException | SecurityException t) {
LOGGER.log(Level.SEVERE, "Minecraft main class not found.", t);
return;
}
LOGGER.info("*** Launching Game ***");
int flag = 0;
try {
minecraftMain.invoke(null, new Object[] { (String[]) cmdList.toArray(new String[cmdList.size()]) });
} catch (Throwable throwable) {
String trace = StrUtils.getStackTrace(throwable);
System.err.println(C.i18n("crash.minecraft"));
System.err.println(MinecraftCrashAdvicer.getAdvice(trace));
System.err.println(trace);
flag = 1;
}
LOGGER.info("*** Game Exited ***");
try {
Utils.shutdownForcely(flag);
} catch (Exception e) {
LOGGER.log(Level.SEVERE, "Failed to shut down this process...", e);
}
}
}
@@ -122,6 +122,8 @@ public final class Main implements Runnable {
if (IUpgrader.NOW_UPGRADER.parseArguments(getVersionNumber(), args))
return;
System.setProperty("awt.useSystemAAFontSettings", "on");
System.setProperty("swing.aatext", "true");
System.setProperty("sun.java2d.noddraw", "true");
System.setProperty("sun.java2d.dpiaware", "false");
Thread.setDefaultUncaughtExceptionHandler(new CrashReporter(true));
@@ -19,6 +19,8 @@ package org.jackhuang.hellominecraft.launcher.core.asset;
import java.io.File;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.HashSet;
import java.util.Map;
import org.jackhuang.hellominecraft.util.C;
@@ -30,8 +32,8 @@ import org.jackhuang.hellominecraft.util.system.IOUtils;
import org.jackhuang.hellominecraft.util.StrUtils;
import org.jackhuang.hellominecraft.launcher.core.download.IDownloadProvider;
import org.jackhuang.hellominecraft.launcher.core.version.MinecraftVersion;
import org.jackhuang.hellominecraft.util.OverridableSwingWorker;
import org.jackhuang.hellominecraft.util.VersionNumber;
import org.jackhuang.hellominecraft.util.tasks.TaskInfo;
/**
*
@@ -44,19 +46,26 @@ public class AssetsMojangLoader extends IAssetsHandler {
}
@Override
public OverridableSwingWorker<String[]> getList(final MinecraftVersion mv, final IMinecraftAssetService mp) {
return new OverridableSwingWorker<String[]>() {
public Task getList(final MinecraftVersion mv, final IMinecraftAssetService mp) {
if (mv == null)
throw new IllegalArgumentException("AssetsMojangLoader: null argument: MinecraftVersion");
String assetsId = mv.getAssetsIndex().getId();
File assets = mp.getAssets();
HMCLog.log("Gathering asset index: " + assetsId);
File f = IOUtils.tryGetCanonicalFile(new File(assets, "indexes/" + assetsId + ".json"));
return new TaskInfo("Gather asset index") {
@Override
protected void work() throws Exception {
if (mv == null)
throw new IllegalArgumentException("AssetsMojangLoader: null argument: MinecraftVersion");
String assetsId = mv.getAssetsIndex().getId();
File assets = mp.getAssets();
HMCLog.log("Gathering asset index: " + assetsId);
File f = IOUtils.tryGetCanonicalFile(new File(assets, "indexes/" + assetsId + ".json"));
if (!f.exists() && !mp.downloadMinecraftAssetsIndex(mv.getAssetsIndex()))
throw new IllegalStateException("Failed to get index json");
public Collection<Task> getDependTasks() {
if (!f.exists())
return Arrays.asList(mp.downloadMinecraftAssetsIndex(mv.getAssetsIndex()));
else
return null;
}
@Override
public void executeTask() throws Throwable {
if (!areDependTasksSucceeded)
throw new IllegalStateException("Failed to get asset index");
String result = FileUtils.readFileToString(f);
if (StrUtils.isBlank(result))
throw new IllegalStateException("Index json is empty, please redownload it!");
@@ -66,6 +75,7 @@ public class AssetsMojangLoader extends IAssetsHandler {
ArrayList<String> al = new ArrayList<>();
contents = new ArrayList<>();
HashSet<String> loadedHashes = new HashSet<>();
int pgs = 0;
if (o != null && o.getFileMap() != null)
for (Map.Entry<String, AssetsObject> e : o.getFileMap().entrySet()) {
if (loadedHashes.contains(e.getValue().getHash()))
@@ -79,9 +89,9 @@ public class AssetsMojangLoader extends IAssetsHandler {
assetsDownloadURLs.add(c.key);
assetsLocalNames.add(new File(assets, "objects" + File.separator + c.key.replace("/", File.separator)));
al.add(e.getKey());
if (ppl != null)
ppl.setProgress(this, ++pgs, o.getFileMap().size());
}
publish(al.toArray(new String[1]));
}
};
}
@@ -74,7 +74,7 @@ public abstract class IAssetsHandler {
* @param mp Asset Service
* @param x finished event
*/
public abstract OverridableSwingWorker<String[]> getList(MinecraftVersion mv, IMinecraftAssetService mp);
public abstract Task getList(MinecraftVersion mv, IMinecraftAssetService mp);
/**
* Will be invoked when the user invoked "Download all assets".
@@ -20,6 +20,7 @@ package org.jackhuang.hellominecraft.launcher.core.asset;
import com.google.gson.JsonSyntaxException;
import java.io.File;
import java.io.IOException;
import java.util.Arrays;
import java.util.Collection;
import java.util.HashSet;
import java.util.Map;
@@ -58,15 +59,17 @@ public class MinecraftAssetService extends IMinecraftAssetService {
Collection<Task> afters = new HashSet<>();
@Override
public void executeTask() throws Throwable {
IAssetsHandler type = IAssetsHandler.ASSETS_HANDLER;
type.getList(mv, service.asset()).justDo();
afters.add(type.getDownloadTask(service.getDownloadType().getProvider()));
public Collection<Task> getDependTasks() {
return Arrays.asList(IAssetsHandler.ASSETS_HANDLER.getList(mv, service.asset()));
}
@Override
public void executeTask() {
}
@Override
public Collection<Task> getAfterTasks() {
return afters;
return Arrays.asList(IAssetsHandler.ASSETS_HANDLER.getDownloadTask(service.getDownloadType().getProvider()));
}
};
}
@@ -76,11 +79,41 @@ public class MinecraftAssetService extends IMinecraftAssetService {
MinecraftVersion mv = service.version().getVersionById(id);
if (mv == null)
return false;
return downloadMinecraftAssetsIndex(mv.getAssetsIndex());
return downloadMinecraftAssetsIndexAsync(mv.getAssetsIndex());
}
@Override
public boolean downloadMinecraftAssetsIndex(AssetIndexDownloadInfo assets) {
public Task downloadMinecraftAssetsIndex(AssetIndexDownloadInfo assets) {
File assetsLocation = getAssets();
if (!assetsLocation.exists() && !assetsLocation.mkdirs())
HMCLog.warn("Failed to make directories: " + assetsLocation);
File assetsIndex = new File(assetsLocation, "indexes/" + assets.getId() + ".json");
File renamed = null;
if (assetsIndex.exists()) {
renamed = new File(assetsLocation, "indexes/" + assets.getId() + "-renamed.json");
if (assetsIndex.renameTo(renamed))
HMCLog.warn("Failed to rename " + assetsIndex + " to " + renamed);
}
File renamedFinal = renamed;
return new TaskInfo("Download Asset Index") {
@Override
public Collection<Task> getDependTasks() {
return Arrays.asList(new FileDownloadTask(assets.getUrl(service.getDownloadType()), IOUtils.tryGetCanonicalFile(assetsIndex), assets.sha1).setTag(assets.getId() + ".json"));
}
@Override
public void executeTask() throws Throwable {
if (areDependTasksSucceeded) {
if (renamedFinal != null && !renamedFinal.delete())
HMCLog.warn("Failed to delete " + renamedFinal + ", maybe you should do it.");
} else if (renamedFinal != null && !renamedFinal.renameTo(assetsIndex))
HMCLog.warn("Failed to rename " + renamedFinal + " to " + assetsIndex);
}
};
}
@Override
public boolean downloadMinecraftAssetsIndexAsync(AssetIndexDownloadInfo assets) {
File assetsLocation = getAssets();
if (!assetsLocation.exists() && !assetsLocation.mkdirs())
HMCLog.warn("Failed to make directories: " + assetsLocation);
@@ -57,7 +57,7 @@ public class BMCLAPIDownloadProvider extends IDownloadProvider {
@Override
public String getVersionsListDownloadURL() {
return "http://bmclapi2.bangbang93.com/versions/versions.json";
return "http://bmclapi2.bangbang93.com/mc/game/version_manifest.json";
}
@Override
@@ -66,13 +66,17 @@ public class BMCLAPIDownloadProvider extends IDownloadProvider {
}
@Override
public String getParsedLibraryDownloadURL(String str) {
return str == null ? null : str.replace("http://files.minecraftforge.net/maven", "http://bmclapi2.bangbang93.com/maven");
public String getParsedDownloadURL(String str) {
return str == null ? null
: str.replace("https://launchermeta.mojang.com", "http://bmclapi2.bangbang93.com")
.replace("https://launcher.mojang.com", "http://bmclapi2.bangbang93.com")
.replace("https://libraries.minecraft.net", "http://bmclapi2.bangbang93.com/libraries")
.replace("http://files.minecraftforge.net/maven", "http://bmclapi2.bangbang93.com/maven");
}
@Override
public boolean isAllowedToUseSelfURL() {
return false;
return true;
}
}
@@ -24,7 +24,7 @@ package org.jackhuang.hellominecraft.launcher.core.download;
public class CurseDownloadProvider extends MojangDownloadProvider {
@Override
public String getParsedLibraryDownloadURL(String str) {
public String getParsedDownloadURL(String str) {
return str == null ? null : str.replace("http://files.minecraftforge.net/maven", "http://ftb.cursecdn.com/FTB2/maven/");
}
@@ -55,7 +55,15 @@ public abstract class IDownloadProvider {
public abstract String getAssetsDownloadURL();
public abstract String getParsedLibraryDownloadURL(String str);
/**
* For example, minecraft.json/assetIndex/url or
* minecraft.json/downloads/client/url
*
* @param str baseURL
*
* @return parsedURL
*/
public abstract String getParsedDownloadURL(String str);
public abstract boolean isAllowedToUseSelfURL();
}
@@ -21,6 +21,7 @@ import org.jackhuang.hellominecraft.launcher.core.service.IMinecraftDownloadServ
import com.google.gson.JsonSyntaxException;
import java.io.File;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.HashSet;
import java.util.List;
@@ -31,11 +32,9 @@ import org.jackhuang.hellominecraft.launcher.core.service.IMinecraftService;
import org.jackhuang.hellominecraft.launcher.core.version.GameDownloadInfo;
import org.jackhuang.hellominecraft.launcher.core.version.IMinecraftLibrary;
import org.jackhuang.hellominecraft.launcher.core.version.MinecraftVersion;
import org.jackhuang.hellominecraft.util.tasks.TaskWindow;
import org.jackhuang.hellominecraft.util.tasks.download.FileDownloadTask;
import org.jackhuang.hellominecraft.util.func.Function;
import org.jackhuang.hellominecraft.util.system.FileUtils;
import org.jackhuang.hellominecraft.util.tasks.DoingDoneListener;
import org.jackhuang.hellominecraft.util.tasks.Task;
import org.jackhuang.hellominecraft.util.tasks.TaskInfo;
@@ -60,7 +59,7 @@ public class MinecraftDownloadService extends IMinecraftDownloadService {
if (l.allow()) {
File ff = l.getFilePath(service.baseDirectory());
if (!ff.exists()) {
String libURL = service.getDownloadType().getProvider().getParsedLibraryDownloadURL(l.getDownloadInfo().getUrl(service.getDownloadType()));
String libURL = l.getDownloadInfo().getUrl(service.getDownloadType());
if (libURL != null)
downloadLibraries.add(new DownloadLibraryJob(l, libURL, ff));
}
@@ -71,58 +70,31 @@ public class MinecraftDownloadService extends IMinecraftDownloadService {
@Override
public Task downloadMinecraft(String id) {
return new TaskInfo("Download Minecraft") {
@Override
public Collection<Task> getDependTasks() {
return Arrays.asList(downloadMinecraftVersionJson(id));
}
@Override
public void executeTask() throws Throwable {
List<MinecraftRemoteVersion> versions = MinecraftRemoteVersions.getRemoteVersions(service.getDownloadType()).justDo();
MinecraftRemoteVersion currentVersion = null;
for (MinecraftRemoteVersion v : versions)
if (id.equals(v.id)) {
currentVersion = v;
break;
}
if (currentVersion == null)
throw new RuntimeException("Cannot find version: " + id + " in remote repository.");
String jsonURL = currentVersion.getUrl(service.getDownloadType());
File vpath = new File(service.baseDirectory(), "versions/" + id);
File mvt = new File(vpath, id + ".json");
if (!areDependTasksSucceeded) {
FileUtils.deleteDirectory(vpath);
throw new RuntimeException("Cannot continue because of download failing.");
}
File mvj = new File(vpath, id + ".jar");
if (!vpath.exists() && !vpath.mkdirs())
HMCLog.warn("Failed to make directories: " + vpath);
if (mvt.exists() && !mvt.delete())
HMCLog.warn("Failed to delete " + mvt);
if (mvj.exists() && !mvj.delete())
HMCLog.warn("Failed to delete " + mvj);
try {
MinecraftVersion mv = C.GSON.fromJson(FileUtils.readFileToStringQuietly(new File(vpath, id + ".json")), MinecraftVersion.class);
if (mv == null)
throw new JsonSyntaxException("incorrect version");
Task t = new FileDownloadTask(jsonURL, mvt).setTag(id + ".json");
t.addTaskListener(new DoingDoneListener<Task>() {
@Override
public void onDone(Task k, Collection<Task> taskCollection) {
MinecraftVersion mv;
try {
mv = C.GSON.fromJson(FileUtils.readFileToStringQuietly(mvt), MinecraftVersion.class);
if (mv == null)
throw new JsonSyntaxException("incorrect version");
} catch (JsonSyntaxException ex) {
HMCLog.err("Failed to parse minecraft version json.", ex);
onFailed(k);
return;
}
GameDownloadInfo i = mv.getClientDownloadInfo();
taskCollection.add(new FileDownloadTask(i.getUrl(service.getDownloadType()), mvj, i.sha1)
.setFailedCallbackReturnsNewURL(new DownloadTypeSwitcher(id + "/" + id + ".jar")).setTag(id + ".jar"));
}
@Override
public void onDoing(Task k, Collection<Task> taskCollection) {
}
@Override
public void onFailed(Task k) {
FileUtils.deleteDirectoryQuietly(vpath);
}
});
afters.add(t);
afters.add(downloadMinecraftJar(mv, mvj));
} catch (JsonSyntaxException ex) {
HMCLog.err("Failed to parse minecraft version json.", ex);
FileUtils.deleteDirectory(vpath);
}
}
Collection<Task> afters = new HashSet<>();
@@ -134,34 +106,6 @@ public class MinecraftDownloadService extends IMinecraftDownloadService {
};
}
@Override
public boolean downloadMinecraftJar(String id) {
String vurl = service.getDownloadType().getProvider().getVersionsDownloadURL() + id + "/";
File vpath = new File(service.baseDirectory(), "versions/" + id);
File mvv = new File(vpath, id + ".jar"), moved = null;
if (mvv.exists()) {
moved = new File(vpath, id + "-renamed.jar");
if (!mvv.renameTo(moved))
HMCLog.warn("Failed to rename " + mvv + " to " + moved);
}
File mvt = new File(vpath, id + ".jar");
if (!vpath.exists() && !vpath.mkdirs())
HMCLog.warn("Failed to make version folder " + vpath);
if (TaskWindow.factory()
.append(new FileDownloadTask(vurl + id + ".jar", mvt).setFailedCallbackReturnsNewURL(new DownloadTypeSwitcher(id + "/" + id + ".jar")).setTag(id + ".jar"))
.create()) {
if (moved != null && moved.exists() && !moved.delete())
HMCLog.warn("Failed to delete " + moved);
return true;
} else {
if (mvt.exists() && !mvt.delete())
HMCLog.warn("Failed to delete game jar " + mvt);
if (moved != null && moved.exists() && !moved.renameTo(mvt))
HMCLog.warn("Failed to rename " + moved + " to " + mvt);
return false;
}
}
private static class DownloadTypeSwitcher implements Function<Integer, String> {
String suffix;
@@ -178,37 +122,43 @@ public class MinecraftDownloadService extends IMinecraftDownloadService {
}
@Override
public Task downloadMinecraftJarTo(MinecraftVersion mv, File mvt) {
String jar = mv.jar == null ? mv.id : mv.jar;
public Task downloadMinecraftJar(MinecraftVersion mv, File mvj) {
GameDownloadInfo i = mv.getClientDownloadInfo();
return new FileDownloadTask(i.getUrl(service.getDownloadType(), true), mvt, i.sha1).setTag(jar + ".jar");
return new FileDownloadTask(i.getUrl(service.getDownloadType()), mvj, i.sha1)
.setFailedCallbackReturnsNewURL(new DownloadTypeSwitcher(mv.id + "/" + mv.id + ".jar")).setTag(mv.id + ".jar");
}
@Override
public boolean downloadMinecraftVersionJson(String id) {
String vurl = service.getDownloadType().getProvider().getVersionsDownloadURL() + id + "/";
File vpath = new File(service.baseDirectory(), "versions/" + id);
File mvv = new File(vpath, id + ".json"), moved = null;
if (mvv.exists()) {
moved = new File(vpath, id + "-renamed.json");
if (!mvv.renameTo(moved))
HMCLog.warn("Failed to rename " + mvv + " to " + moved);
}
File mvt = new File(vpath, id + ".json");
if (!vpath.exists() && !vpath.mkdirs())
HMCLog.warn("Failed to make version folder " + vpath);
if (TaskWindow.factory()
.append(new FileDownloadTask(vurl + id + ".json", mvt).setTag(id + ".json"))
.create()) {
if (moved != null && moved.exists() && !moved.delete())
HMCLog.warn("Failed to delete " + moved);
return true;
} else {
if (mvt.exists() && !mvt.delete())
HMCLog.warn("Failed to delete minecraft version json" + mvt);
if (moved != null && moved.exists() && !moved.renameTo(mvt))
HMCLog.warn("Failed to rename " + moved + " to " + mvt);
return false;
}
public Task downloadMinecraftVersionJson(String id) {
return new TaskInfo("Download Minecraft Json") {
@Override
public void executeTask() throws Throwable {
List<MinecraftRemoteVersion> versions = MinecraftRemoteVersions.getRemoteVersions(service.getDownloadType()).justDo();
MinecraftRemoteVersion currentVersion = null;
for (MinecraftRemoteVersion v : versions)
if (id.equals(v.id)) {
currentVersion = v;
break;
}
if (currentVersion == null)
throw new RuntimeException("Cannot find version: " + id + " in remote repository.");
String jsonURL = currentVersion.getUrl(service.getDownloadType());
File vpath = new File(service.baseDirectory(), "versions/" + id);
File mvt = new File(vpath, id + ".json");
if (!vpath.exists() && !vpath.mkdirs())
HMCLog.warn("Failed to make directories: " + vpath);
if (mvt.exists() && !mvt.delete())
HMCLog.warn("Failed to delete " + mvt);
afters.add(new FileDownloadTask(jsonURL, mvt).setTag(id + ".json"));
}
Collection<Task> afters = new HashSet<>();
@Override
public Collection<Task> getAfterTasks() {
return afters;
}
};
}
}
@@ -73,9 +73,11 @@ public class MojangDownloadProvider extends IDownloadProvider {
}
@Override
public String getParsedLibraryDownloadURL(String str) {
public String getParsedDownloadURL(String str) {
if (str == null)
return null;
else if (str.contains("scala-swing") || str.contains("scala-xml") || str.contains("scala-parser-combinators"))
return str.replace("http://files.minecraftforge.net/maven", "http://ftb.cursecdn.com/FTB2/maven/");
else if (str.contains("typesafe") || str.contains("scala"))
if (SupportedLocales.NOW_LOCALE.self == Locale.CHINA)
return str.replace("http://files.minecraftforge.net/maven", "http://maven.oschina.net/content/groups/public");
@@ -84,5 +86,4 @@ public class MojangDownloadProvider extends IDownloadProvider {
else
return str;
}
}
@@ -49,7 +49,7 @@ public class RapidDataDownloadProvider extends MojangDownloadProvider {
}
@Override
public String getParsedLibraryDownloadURL(String str) {
public String getParsedDownloadURL(String str) {
return str == null ? null : str.replace("http://files.minecraftforge.net/maven", "http://mirrors.rapiddata.org/forge/maven");
}
@@ -64,7 +64,7 @@ public final class MinecraftInstallerService extends IMinecraftInstallerService
File filepath = IOUtils.tryGetCanonicalFile(IOUtils.currentDirWithSeparator() + "forge-installer.jar");
if (v.installer != null)
TaskWindow.factory()
.append(new FileDownloadTask(service.getDownloadType().getProvider().getParsedLibraryDownloadURL(v.installer), filepath).setTag("forge"))
.append(new FileDownloadTask(service.getDownloadType().getProvider().getParsedDownloadURL(v.installer), filepath).setTag("forge"))
.append(new ForgeInstaller(service, filepath))
.create();
}
@@ -51,7 +51,7 @@ public class MinecraftForgeVersionList extends InstallerVersionList {
public void refreshList(String[] needed) throws Exception {
if (root != null)
return;
String s = NetUtils.get(DownloadType.getSuggestedDownloadType().getProvider().getParsedLibraryDownloadURL(C.URL_FORGE_LIST));
String s = NetUtils.get(DownloadType.getSuggestedDownloadType().getProvider().getParsedDownloadURL(C.URL_FORGE_LIST));
root = C.GSON.fromJson(s, MinecraftForgeVersionRoot.class);
@@ -70,7 +70,7 @@ public class MinecraftForgeVersionList extends InstallerVersionList {
if (!StrUtils.isBlank(v.branch))
ver = ver + "-" + v.branch;
String filename = root.artifact + "-" + ver + "-" + f[1] + "." + f[0];
String url = DownloadType.getSuggestedDownloadType().getProvider().getParsedLibraryDownloadURL(root.webpath + ver + "/" + filename);
String url = DownloadType.getSuggestedDownloadType().getProvider().getParsedDownloadURL(root.webpath + ver + "/" + filename);
switch (f[1]) {
case "installer":
iv.installer = url;
@@ -30,7 +30,6 @@ import org.jackhuang.hellominecraft.util.system.OS;
import org.jackhuang.hellominecraft.util.system.Platform;
import org.jackhuang.hellominecraft.util.StrUtils;
import org.jackhuang.hellominecraft.util.Utils;
import org.jackhuang.hellominecraft.launcher.Launcher;
import org.jackhuang.hellominecraft.launcher.core.GameException;
import org.jackhuang.hellominecraft.launcher.core.auth.UserProfileProvider;
import org.jackhuang.hellominecraft.launcher.core.version.MinecraftVersion;
@@ -68,6 +67,9 @@ public abstract class AbstractMinecraftLoader implements IMinecraftLoader {
public void makeHeadCommand(List<String> res) {
HMCLog.log("On making head command.");
if (StrUtils.isNotBlank(options.getWrapper()))
res.add(options.getWrapper());
JdkVersion jv = options.getJava();
res.add(options.getJavaDir());
@@ -80,10 +82,12 @@ public abstract class AbstractMinecraftLoader implements IMinecraftLoader {
if (jv == null || !jv.isEarlyAccess()) {
if (OS.os() == OS.WINDOWS)
res.add("-XX:HeapDumpPath=MojangTricksIntelDriversForPerformance_javaw.exe_minecraft.exe.heapdump");
res.add("-XX:+UseConcMarkSweepGC");
if (jv != null && jv.getParsedVersion() >= JdkVersion.JAVA_17)
res.add("-XX:+UseG1GC");
else
res.add("-Xincgc");
res.add("-XX:-UseAdaptiveSizePolicy");
res.add("-XX:-OmitStackTraceInFastThrow");
res.add("-Xincgc");
res.add("-Xmn128m");
}
@@ -125,12 +129,6 @@ public abstract class AbstractMinecraftLoader implements IMinecraftLoader {
if (OS.os() != OS.WINDOWS)
res.add("-Duser.home=" + gameDir.getParent());
if (!options.isCanceledWrapper()) {
res.add("-cp");
res.add(StrUtils.parseParams("", Utils.getURLString(), File.pathSeparator));
res.add(Launcher.class.getCanonicalName());
}
}
@Override
@@ -163,9 +161,6 @@ public abstract class AbstractMinecraftLoader implements IMinecraftLoader {
if (options.isFullscreen())
res.add("--fullscreen");
if (options.isDebug() && !options.isCanceledWrapper())
res.add("-debug");
if (StrUtils.isNotBlank(options.getProxyHost()) && StrUtils.isNotBlank(options.getProxyPort()) && MathUtils.canParseInt(options.getProxyPort())) {
res.add("--proxyHost");
res.add(options.getProxyHost());
@@ -28,9 +28,9 @@ import org.jackhuang.hellominecraft.util.system.JdkVersion;
*/
public class LaunchOptions {
private String name, versionName, javaArgs, minecraftArgs, maxMemory, permSize, width, height, serverIp;
private String name, versionName, javaArgs, minecraftArgs, maxMemory, permSize, width, height, serverIp, wrapper;
private String proxyHost, proxyPort, proxyUser, proxyPass, javaDir, launchVersion, type, precalledCommand;
private boolean fullscreen, debug, noJVMArgs, canceledWrapper;
private boolean fullscreen, noJVMArgs;
private JdkVersion java;
private File gameDir;
private GameDirType gameDirType;
@@ -95,6 +95,14 @@ public class LaunchOptions {
this.maxMemory = maxMemory;
}
public String getWrapper() {
return wrapper;
}
public void setWrapper(String wrapper) {
this.wrapper = wrapper;
}
public String getWidth() {
return width;
}
@@ -119,14 +127,6 @@ public class LaunchOptions {
this.fullscreen = fullscreen;
}
public boolean isDebug() {
return debug;
}
public void setDebug(boolean debug) {
this.debug = debug;
}
public GameDirType getGameDirType() {
return gameDirType;
}
@@ -159,14 +159,6 @@ public class LaunchOptions {
this.minecraftArgs = minecraftArgs;
}
public boolean isCanceledWrapper() {
return canceledWrapper;
}
public void setCanceledWrapper(boolean canceledWrapper) {
this.canceledWrapper = canceledWrapper;
}
public String getServerIp() {
return serverIp;
}
@@ -43,7 +43,7 @@ public class MinecraftLoader extends AbstractMinecraftLoader {
@Override
protected void makeSelf(List<String> res) throws GameException {
StringBuilder library = new StringBuilder(options.isCanceledWrapper() ? "" : "-cp=");
StringBuilder library = new StringBuilder("");
for (MinecraftLibrary l : version.libraries)
if (l.allow() && !l.isRequiredToUnzip())
library.append(l.getFilePath(gameDir).getAbsolutePath()).append(File.pathSeparator);
@@ -51,11 +51,9 @@ public class MinecraftLoader extends AbstractMinecraftLoader {
if (!f.exists())
throw new GameException("Minecraft jar does not exists");
library.append(IOUtils.tryGetCanonicalFilePath(f)).append(File.pathSeparator);
if (options.isCanceledWrapper())
res.add("-cp");
res.add("-cp");
res.add(library.toString().substring(0, library.length() - File.pathSeparator.length()));
String mainClass = version.mainClass;
res.add((options.isCanceledWrapper() ? "" : "-mainClass=") + mainClass);
res.add(version.mainClass);
String[] splitted = StrUtils.tokenize(version.minecraftArguments);
@@ -31,6 +31,7 @@ import java.util.List;
import java.util.Map;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.zip.ZipFile;
import javax.swing.JFrame;
import javax.swing.JOptionPane;
import org.jackhuang.hellominecraft.util.C;
import org.jackhuang.hellominecraft.util.logging.HMCLog;
@@ -46,6 +47,7 @@ import org.jackhuang.hellominecraft.util.system.ZipEngine;
import org.jackhuang.hellominecraft.util.tasks.Task;
import org.jackhuang.hellominecraft.util.ui.WebPage;
import org.jackhuang.hellominecraft.util.MinecraftVersionRequest;
import org.jackhuang.hellominecraft.util.tasks.NoShownTaskException;
/**
* A mod pack(*.zip) includes these things:
@@ -79,14 +81,14 @@ public final class ModpackManager {
* @return The installing Task, may take long time, please consider
* TaskWindow.
*/
public static Task install(final File input, final IMinecraftService service, final String idFUCK) {
public static Task install(JFrame parFrame, final File input, final IMinecraftService service, final String idFUCK) {
return new Task() {
Collection<Task> c = new ArrayList<>();
@Override
public void executeTask() throws Throwable {
String id = idFUCK;
String description = C.i18n("modpack.install.will_install");
String description = C.i18n("modpack.task.install.will");
// Read modpack name and description from `modpack.json`
try (ZipFile zip = new ZipFile(input)) {
@@ -106,12 +108,12 @@ public final class ModpackManager {
// Show a window to let the user know that what and how the modpack is.
Object msgs[] = new Object[2];
msgs[0] = C.i18n("modpack.install.task");
msgs[0] = C.i18n("modpack.task.install");
msgs[1] = new WebPage(description);
((WebPage) msgs[1]).setPreferredSize(new Dimension(800, 350));
int result = JOptionPane.showOptionDialog(null, msgs, (String) msgs[0], JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE, null, null, null);
int result = JOptionPane.showOptionDialog(parFrame, msgs, (String) msgs[0], JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE, null, null, null);
if (result == JOptionPane.NO_OPTION)
return;
throw new NoShownTaskException("Operation was canceled by user.");
File versions = new File(service.baseDirectory(), "versions");
@@ -166,7 +168,7 @@ public final class ModpackManager {
if (mv.jar == null)
throw new FileNotFoundException(C.i18n("modpack.incorrect_format.no_jar"));
c.add(service.download().downloadMinecraftJarTo(mv, new File(nowFile, id + ".jar")));
c.add(service.download().downloadMinecraftJar(mv, new File(nowFile, id + ".jar")));
mv.jar = null;
FileUtils.writeStringToFile(json, C.GSON.toJson(mv));
if (!json.renameTo(new File(nowFile, id + ".json")))
@@ -191,7 +193,7 @@ public final class ModpackManager {
@Override
public String getInfo() {
return C.i18n("modpack.install.task");
return C.i18n("modpack.task.install");
}
@Override
@@ -202,8 +204,8 @@ public final class ModpackManager {
}
public static final List<String> MODPACK_BLACK_LIST = Arrays.asList(new String[] { "usernamecache.json", "asm", "logs", "backups", "versions", "assets", "usercache.json", "libraries", "crash-reports", "launcher_profiles.json", "NVIDIA", "AMD", "TCNodeTracker", "screenshots", "natives", "native", "$native", "pack.json", "launcher.jar", "launcher.pack.lzma", "hmclmc.log" });
public static final List<String> MODPACK_SUGGESTED_BLACK_LIST = Arrays.asList(new String[] { "saves", "servers.dat", "options.txt", "optionsshaders.txt", "mods/VoxelMods" });
public static final List<String> MODPACK_BLACK_LIST = Arrays.asList(new String[] { "usernamecache.json", "asm", "logs", "backups", "versions", "assets", "usercache.json", "libraries", "crash-reports", "launcher_profiles.json", "NVIDIA", "AMD", "TCNodeTracker", "screenshots", "natives", "native", "$native", "pack.json", "launcher.jar", "minetweaker.log", "launcher.pack.lzma", "hmclmc.log" });
public static final List<String> MODPACK_SUGGESTED_BLACK_LIST = Arrays.asList(new String[] { "fonts", "saves", "servers.dat", "options.txt", "optionsof.txt", "journeymap", "optionsshaders.txt", "mods/VoxelMods" });
/**
* &lt; String, Boolean, Boolean &gt;: Folder/File name, Is Directory,
@@ -45,7 +45,9 @@ public abstract class IMinecraftAssetService extends IMinecraftBasicService {
*/
public abstract boolean refreshAssetsIndex(String a);
public abstract boolean downloadMinecraftAssetsIndex(AssetIndexDownloadInfo assetsId);
public abstract boolean downloadMinecraftAssetsIndexAsync(AssetIndexDownloadInfo assetsId);
public abstract Task downloadMinecraftAssetsIndex(AssetIndexDownloadInfo assetsId);
public abstract File getAssetObject(String assetVersion, String name) throws IOException;
}
@@ -22,9 +22,7 @@ import java.util.List;
import org.jackhuang.hellominecraft.launcher.core.GameException;
import org.jackhuang.hellominecraft.launcher.core.download.DownloadLibraryJob;
import org.jackhuang.hellominecraft.launcher.core.version.MinecraftVersion;
import org.jackhuang.hellominecraft.util.OverridableSwingWorker;
import org.jackhuang.hellominecraft.util.tasks.Task;
import org.jackhuang.hellominecraft.launcher.core.download.MinecraftRemoteVersion;
/**
*
@@ -38,11 +36,9 @@ public abstract class IMinecraftDownloadService extends IMinecraftBasicService {
public abstract Task downloadMinecraft(String id);
public abstract boolean downloadMinecraftJar(String id);
public abstract Task downloadMinecraftJar(MinecraftVersion mv, File f);
public abstract Task downloadMinecraftJarTo(MinecraftVersion mv, File f);
public abstract boolean downloadMinecraftVersionJson(String id);
public abstract Task downloadMinecraftVersionJson(String id);
/**
* Get the libraries that need to download.
@@ -36,11 +36,8 @@ public class AssetIndexDownloadInfo extends GameDownloadInfo {
}
@Override
public String getUrl(DownloadType dt, boolean allowSelf) {
if (url != null && dt.getProvider().isAllowedToUseSelfURL())
return url;
else
return dt.getProvider().getIndexesDownloadURL() + id + ".json";
public String getCustomizedURL(DownloadType dt) {
return dt.getProvider().getIndexesDownloadURL() + id + ".json";
}
public String getId() {
@@ -55,9 +55,13 @@ public class GameDownloadInfo implements Cloneable {
*/
public String getUrl(DownloadType dt, boolean allowSelf) {
if (url != null && allowSelf)
return url;
return dt.getProvider().getParsedDownloadURL(url);
else
return dt.getProvider().getVersionsDownloadURL() + id + "/" + id + ".jar";
return getCustomizedURL(dt);
}
protected String getCustomizedURL(DownloadType dt) {
return dt.getProvider().getVersionsDownloadURL() + id + "/" + id + ".jar";
}
@Override
@@ -35,7 +35,10 @@ public class LibraryDownloadInfo extends GameDownloadInfo {
if (StrUtils.isNotBlank(url) && allowSelf)
myURL = url;
if (!myURL.endsWith(".jar"))
myURL += path.replace('\\', '/');
if (path == null)
return null;
else
myURL += path.replace('\\', '/');
return myURL;
}
}
@@ -73,8 +73,9 @@ public class MinecraftVersion implements Cloneable, Comparable<MinecraftVersion>
this.libraries = new ArrayList<>();
else {
this.libraries = new ArrayList<>(libraries.size());
for (IMinecraftLibrary library : libraries)
this.libraries.add((MinecraftLibrary) library.clone());
for (MinecraftLibrary library : libraries)
if (library != null)
this.libraries.add((MinecraftLibrary) library.clone());
}
if (downloads == null)
this.downloads = null;
@@ -31,9 +31,7 @@ import org.jackhuang.hellominecraft.launcher.core.service.IMinecraftProvider;
import org.jackhuang.hellominecraft.launcher.core.service.IMinecraftService;
import org.jackhuang.hellominecraft.util.system.FileUtils;
import org.jackhuang.hellominecraft.launcher.core.MCUtils;
import org.jackhuang.hellominecraft.util.tasks.DecompressTask;
import org.jackhuang.hellominecraft.util.tasks.TaskWindow;
import org.jackhuang.hellominecraft.util.tasks.download.FileDownloadTask;
import org.jackhuang.hellominecraft.util.system.IOUtils;
import org.jackhuang.hellominecraft.util.MessageBox;
import org.jackhuang.hellominecraft.util.StrUtils;
@@ -23,6 +23,7 @@ import java.io.File;
import org.jackhuang.hellominecraft.launcher.api.PluginManager;
import org.jackhuang.hellominecraft.launcher.core.MCUtils;
import org.jackhuang.hellominecraft.launcher.core.service.IMinecraftService;
import org.jackhuang.hellominecraft.launcher.core.version.MinecraftVersion;
import org.jackhuang.hellominecraft.util.system.IOUtils;
import org.jackhuang.hellominecraft.util.StrUtils;
import org.jackhuang.hellominecraft.util.EventHandler;
@@ -53,7 +54,7 @@ public final class Profile {
this();
if (v == null)
return;
name = v.name;
this.name = name;
gameDir = v.gameDir;
}
@@ -87,8 +88,9 @@ public final class Profile {
public String getSelectedVersion() {
String v = selectedMinecraftVersion;
if (StrUtils.isBlank(v) || service().version().getVersionById(v) == null || service().version().getVersionById(v).hidden) {
if (service().version().getVersionCount() > 0)
v = service().version().getOneVersion(t -> !t.hidden).id;
MinecraftVersion mv = service().version().getOneVersion(t -> !t.hidden);
if (mv != null)
v = mv.id;
if (StrUtils.isNotBlank(v))
setSelectedMinecraftVersion(v);
}
@@ -40,8 +40,8 @@ public class VersionSetting {
public transient String id;
private String javaArgs, minecraftArgs, maxMemory, permSize, width, height;
private String javaDir, precalledCommand, serverIp, java;
private boolean fullscreen, debug, noJVMArgs, canceledWrapper;
private String javaDir, precalledCommand, serverIp, java, wrapper;
private boolean fullscreen, noJVMArgs;
/**
* 0 - Close the launcher when the game starts.<br/>
@@ -59,10 +59,10 @@ public class VersionSetting {
public transient final EventHandler<String> propertyChanged = new EventHandler<>(this);
public VersionSetting() {
debug = fullscreen = canceledWrapper = false;
fullscreen = false;
launcherVisibility = 1;
gameDirType = 0;
javaDir = java = minecraftArgs = serverIp = precalledCommand = "";
javaDir = java = minecraftArgs = serverIp = precalledCommand = wrapper = "";
}
public VersionSetting(VersionSetting v) {
@@ -76,14 +76,13 @@ public class VersionSetting {
fullscreen = v.fullscreen;
javaArgs = v.javaArgs;
javaDir = v.javaDir;
debug = v.debug;
minecraftArgs = v.minecraftArgs;
permSize = v.permSize;
gameDirType = v.gameDirType;
canceledWrapper = v.canceledWrapper;
noJVMArgs = v.noJVMArgs;
launcherVisibility = v.launcherVisibility;
precalledCommand = v.precalledCommand;
wrapper = v.wrapper;
serverIp = v.serverIp;
}
@@ -117,7 +116,7 @@ public class VersionSetting {
java = "Custom";
int idx = Java.JAVA.indexOf(new Java(java, null));
if (idx == -1) {
java = "Default";
java = Java.suggestedJava().getName();
idx = 0;
}
return idx;
@@ -192,15 +191,6 @@ public class VersionSetting {
propertyChanged.execute("fullscreen");
}
public boolean isDebug() {
return debug;
}
public void setDebug(boolean debug) {
this.debug = debug;
propertyChanged.execute("debug");
}
public LauncherVisibility getLauncherVisibility() {
return LauncherVisibility.values()[launcherVisibility];
}
@@ -248,15 +238,6 @@ public class VersionSetting {
propertyChanged.execute("minecraftArgs");
}
public boolean isCanceledWrapper() {
return canceledWrapper;
}
public void setCanceledWrapper(boolean canceledWrapper) {
this.canceledWrapper = canceledWrapper;
propertyChanged.execute("canceledWrapper");
}
public String getPrecalledCommand() {
return precalledCommand;
}
@@ -266,6 +247,15 @@ public class VersionSetting {
propertyChanged.execute("precalledCommand");
}
public String getWrapper() {
return wrapper;
}
public void setWrapper(String wrapper) {
this.wrapper = wrapper;
propertyChanged.execute("wrapper");
}
public String getServerIp() {
return serverIp;
}
@@ -277,9 +267,8 @@ public class VersionSetting {
public LaunchOptions createLaunchOptions(File gameDir) {
LaunchOptions x = new LaunchOptions();
x.setCanceledWrapper(isCanceledWrapper());
x.setDebug(isDebug());
x.setFullscreen(isFullscreen());
x.setWrapper(getWrapper());
x.setGameDir(gameDir);
x.setGameDirType(getGameDirType());
x.setHeight(getHeight());
@@ -63,7 +63,7 @@
</Group>
<Group type="103" rootIndex="1" groupAlignment="0" attributes="0">
<Group type="102" alignment="1" attributes="0">
<EmptySpace pref="402" max="32767" attributes="0"/>
<EmptySpace pref="576" max="32767" attributes="0"/>
<Component id="btnIncludeMinecraft" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
</Group>
@@ -195,7 +195,7 @@
<Component id="lblDimension" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="txtWidth" alignment="3" min="-2" pref="26" max="-2" attributes="0"/>
</Group>
<EmptySpace pref="54" max="32767" attributes="0"/>
<EmptySpace pref="228" max="32767" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="btnDownloadAllAssets" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="btnCleanGame" alignment="3" min="-2" max="-2" attributes="0"/>
@@ -389,39 +389,40 @@
<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="txtPrecalledCommand" alignment="0" max="32767" attributes="0"/>
<Component id="txtServerIP" alignment="0" max="32767" attributes="0"/>
<Group type="102" attributes="0">
<Group type="103" groupAlignment="0" attributes="0">
<Component id="lblPrecalledCommand" alignment="0" min="-2" max="-2" attributes="0"/>
<Group type="102" alignment="0" attributes="0">
<Component id="chkDebug" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="chkCancelWrapper" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="chkNoJVMArgs" min="-2" max="-2" attributes="0"/>
</Group>
<Component id="lblServerIP" alignment="0" min="-2" max="-2" attributes="0"/>
</Group>
<Component id="txtWrapperLauncher" alignment="0" max="32767" attributes="0"/>
<Group type="102" alignment="0" attributes="0">
<Component id="lblPrecalledCommand1" min="-2" max="-2" attributes="0"/>
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
</Group>
<Group type="102" alignment="1" attributes="0">
<Group type="103" groupAlignment="0" attributes="0">
<Component id="lblMinecraftArgs" alignment="0" min="-2" max="-2" attributes="0"/>
<Component id="lblPermSize" alignment="0" min="-2" max="-2" attributes="0"/>
<Component id="lblJavaArgs" alignment="0" min="-2" max="-2" attributes="0"/>
</Group>
</Group>
<EmptySpace max="-2" attributes="0"/>
</Group>
<Component id="txtPrecalledCommand" alignment="0" max="32767" attributes="0"/>
<Component id="txtServerIP" alignment="0" max="32767" attributes="0"/>
<Group type="102" alignment="1" attributes="0">
<Group type="103" groupAlignment="0" attributes="0">
<Component id="lblMinecraftArgs" alignment="0" min="-2" max="-2" attributes="0"/>
<Component id="lblPermSize" alignment="0" min="-2" max="-2" attributes="0"/>
<Component id="lblJavaArgs" alignment="0" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Component id="txtJavaArgs" pref="664" max="32767" attributes="0"/>
<Component id="txtMinecraftArgs" max="32767" attributes="0"/>
<Component id="txtPermSize" alignment="1" max="32767" attributes="0"/>
</Group>
</Group>
<Group type="102" attributes="0">
<Group type="103" groupAlignment="0" attributes="0">
<Component id="lblPrecalledCommand" alignment="0" min="-2" max="-2" attributes="0"/>
<Component id="lblServerIP" alignment="0" min="-2" max="-2" attributes="0"/>
<Group type="102" alignment="0" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Component id="txtJavaArgs" max="32767" attributes="0"/>
<Component id="txtMinecraftArgs" max="32767" attributes="0"/>
<Component id="txtPermSize" alignment="1" max="32767" attributes="0"/>
</Group>
<Component id="chkNoJVMArgs" min="-2" max="-2" attributes="0"/>
</Group>
</Group>
<EmptySpace min="-2" pref="0" max="-2" attributes="0"/>
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
@@ -444,6 +445,10 @@
<Component id="lblPermSize" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace max="-2" attributes="0"/>
<Component id="lblPrecalledCommand1" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="txtWrapperLauncher" min="-2" pref="26" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="lblPrecalledCommand" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="txtPrecalledCommand" min="-2" pref="26" max="-2" attributes="0"/>
@@ -451,28 +456,14 @@
<Component id="lblServerIP" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="txtServerIP" min="-2" pref="26" max="-2" attributes="0"/>
<EmptySpace pref="46" max="32767" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="chkDebug" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="chkNoJVMArgs" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="chkCancelWrapper" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace pref="168" max="32767" attributes="0"/>
<Component id="chkNoJVMArgs" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
</Layout>
<SubComponents>
<Component class="javax.swing.JCheckBox" name="chkDebug">
<Properties>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="org/jackhuang/hellominecraft/launcher/I18N.properties" key="advancedsettings.debug_mode" replaceFormat="C.i18n(&quot;{key}&quot;)"/>
</Property>
</Properties>
<Events>
<EventHandler event="itemStateChanged" listener="java.awt.event.ItemListener" parameters="java.awt.event.ItemEvent" handler="chkDebugItemStateChanged"/>
</Events>
</Component>
<Component class="javax.swing.JLabel" name="lblJavaArgs">
<Properties>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
@@ -524,20 +515,10 @@
<EventHandler event="itemStateChanged" listener="java.awt.event.ItemListener" parameters="java.awt.event.ItemEvent" handler="chkNoJVMArgsItemStateChanged"/>
</Events>
</Component>
<Component class="javax.swing.JCheckBox" name="chkCancelWrapper">
<Properties>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="org/jackhuang/hellominecraft/launcher/I18N.properties" key="advancedsettings.cancel_wrapper_launcher" replaceFormat="C.i18n(&quot;{key}&quot;)"/>
</Property>
</Properties>
<Events>
<EventHandler event="itemStateChanged" listener="java.awt.event.ItemListener" parameters="java.awt.event.ItemEvent" handler="chkCancelWrapperItemStateChanged"/>
</Events>
</Component>
<Component class="javax.swing.JLabel" name="lblPrecalledCommand">
<Properties>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="org/jackhuang/hellominecraft/launcher/I18N.properties" key="advancedsettings.wrapper_launcher" replaceFormat="C.i18n(&quot;{key}&quot;)"/>
<ResourceString bundle="org/jackhuang/hellominecraft/lang/I18N.properties" key="advancedsettings.precall_command" replaceFormat="C.i18n(&quot;{key}&quot;)"/>
</Property>
</Properties>
</Component>
@@ -558,6 +539,18 @@
<EventHandler event="focusLost" listener="java.awt.event.FocusListener" parameters="java.awt.event.FocusEvent" handler="txtServerIPFocusLost"/>
</Events>
</Component>
<Component class="javax.swing.JLabel" name="lblPrecalledCommand1">
<Properties>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="org/jackhuang/hellominecraft/lang/I18N.properties" key="advancedsettings.wrapper_launcher" replaceFormat="C.i18n(&quot;{key}&quot;)"/>
</Property>
</Properties>
</Component>
<Component class="javax.swing.JTextField" name="txtWrapperLauncher">
<Events>
<EventHandler event="focusLost" listener="java.awt.event.FocusListener" parameters="java.awt.event.FocusEvent" handler="txtWrapperLauncherFocusLost"/>
</Events>
</Component>
</SubComponents>
</Container>
<Container class="javax.swing.JPanel" name="pnlModManagement">
@@ -616,7 +609,7 @@
<Component id="btnRemoveMod" min="-2" max="-2" attributes="0"/>
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
</Group>
<Component id="jScrollPane1" pref="254" max="32767" attributes="0"/>
<Component id="jScrollPane1" pref="428" max="32767" attributes="0"/>
</Group>
<EmptySpace min="-2" max="-2" attributes="0"/>
<Component id="lblModInfo" min="-2" max="-2" attributes="0"/>
@@ -64,6 +64,7 @@ import org.jackhuang.hellominecraft.util.system.FileUtils;
import org.jackhuang.hellominecraft.util.system.IOUtils;
import org.jackhuang.hellominecraft.util.ui.SwingUtils;
import org.jackhuang.hellominecraft.util.system.Java;
import org.jackhuang.hellominecraft.util.tasks.TaskWindow;
import org.jackhuang.hellominecraft.util.ui.LogWindow;
/**
@@ -276,7 +277,6 @@ public final class GameSettingsPanel extends AnimatedPanel implements DropTarget
btnChoosingGameDir = new javax.swing.JButton();
btnCleanGame = new javax.swing.JButton();
pnlAdvancedSettings = new AnimatedPanel();
chkDebug = new javax.swing.JCheckBox();
lblJavaArgs = new javax.swing.JLabel();
txtJavaArgs = new javax.swing.JTextField();
txtMinecraftArgs = new javax.swing.JTextField();
@@ -284,11 +284,12 @@ public final class GameSettingsPanel extends AnimatedPanel implements DropTarget
lblPermSize = new javax.swing.JLabel();
txtPermSize = new javax.swing.JTextField();
chkNoJVMArgs = new javax.swing.JCheckBox();
chkCancelWrapper = new javax.swing.JCheckBox();
lblPrecalledCommand = new javax.swing.JLabel();
txtPrecalledCommand = new javax.swing.JTextField();
lblServerIP = new javax.swing.JLabel();
txtServerIP = new javax.swing.JTextField();
lblPrecalledCommand1 = new javax.swing.JLabel();
txtWrapperLauncher = new javax.swing.JTextField();
pnlModManagement = new AnimatedPanel();
pnlModManagementContent = new javax.swing.JPanel();
jScrollPane1 = new javax.swing.JScrollPane();
@@ -505,7 +506,7 @@ public final class GameSettingsPanel extends AnimatedPanel implements DropTarget
.addComponent(lblDimensionX, javax.swing.GroupLayout.PREFERRED_SIZE, 26, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(lblDimension)
.addComponent(txtWidth, javax.swing.GroupLayout.PREFERRED_SIZE, 26, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 54, Short.MAX_VALUE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 228, Short.MAX_VALUE)
.addGroup(pnlSettingsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(btnDownloadAllAssets)
.addComponent(btnCleanGame))
@@ -514,13 +515,6 @@ public final class GameSettingsPanel extends AnimatedPanel implements DropTarget
tabVersionEdit.addTab(C.i18n("settings"), pnlSettings); // NOI18N
chkDebug.setText(C.i18n("advancedsettings.debug_mode")); // NOI18N
chkDebug.addItemListener(new java.awt.event.ItemListener() {
public void itemStateChanged(java.awt.event.ItemEvent evt) {
chkDebugItemStateChanged(evt);
}
});
lblJavaArgs.setText(C.i18n("advancedsettings.jvm_args")); // NOI18N
txtJavaArgs.setToolTipText(C.i18n("advancedsettings.java_args_default")); // NOI18N
@@ -553,14 +547,7 @@ public final class GameSettingsPanel extends AnimatedPanel implements DropTarget
}
});
chkCancelWrapper.setText(C.i18n("advancedsettings.cancel_wrapper_launcher")); // NOI18N
chkCancelWrapper.addItemListener(new java.awt.event.ItemListener() {
public void itemStateChanged(java.awt.event.ItemEvent evt) {
chkCancelWrapperItemStateChanged(evt);
}
});
lblPrecalledCommand.setText(C.i18n("advancedsettings.wrapper_launcher")); // NOI18N
lblPrecalledCommand.setText(C.i18n("advancedsettings.precall_command")); // NOI18N
txtPrecalledCommand.addFocusListener(new java.awt.event.FocusAdapter() {
public void focusLost(java.awt.event.FocusEvent evt) {
@@ -576,37 +563,47 @@ public final class GameSettingsPanel extends AnimatedPanel implements DropTarget
}
});
lblPrecalledCommand1.setText(C.i18n("advancedsettings.wrapper_launcher")); // NOI18N
txtWrapperLauncher.addFocusListener(new java.awt.event.FocusAdapter() {
public void focusLost(java.awt.event.FocusEvent evt) {
txtWrapperLauncherFocusLost(evt);
}
});
javax.swing.GroupLayout pnlAdvancedSettingsLayout = new javax.swing.GroupLayout(pnlAdvancedSettings);
pnlAdvancedSettings.setLayout(pnlAdvancedSettingsLayout);
pnlAdvancedSettingsLayout.setHorizontalGroup(
pnlAdvancedSettingsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(pnlAdvancedSettingsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(pnlAdvancedSettingsLayout.createSequentialGroup()
.addGroup(pnlAdvancedSettingsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(txtWrapperLauncher)
.addGroup(pnlAdvancedSettingsLayout.createSequentialGroup()
.addComponent(lblPrecalledCommand1)
.addGap(0, 0, Short.MAX_VALUE)))
.addContainerGap())
.addComponent(txtPrecalledCommand)
.addComponent(txtServerIP)
.addGroup(pnlAdvancedSettingsLayout.createSequentialGroup()
.addGroup(pnlAdvancedSettingsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(lblPrecalledCommand)
.addComponent(lblServerIP))
.addGap(0, 716, Short.MAX_VALUE))
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, pnlAdvancedSettingsLayout.createSequentialGroup()
.addGroup(pnlAdvancedSettingsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(lblMinecraftArgs)
.addComponent(lblPermSize)
.addComponent(lblJavaArgs))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(pnlAdvancedSettingsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(txtJavaArgs)
.addComponent(txtMinecraftArgs)
.addComponent(txtPermSize, javax.swing.GroupLayout.Alignment.TRAILING))))
.addGroup(pnlAdvancedSettingsLayout.createSequentialGroup()
.addGap(0, 0, 0)
.addGroup(pnlAdvancedSettingsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(txtPrecalledCommand)
.addComponent(txtServerIP)
.addGroup(pnlAdvancedSettingsLayout.createSequentialGroup()
.addGroup(pnlAdvancedSettingsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(lblPrecalledCommand)
.addGroup(pnlAdvancedSettingsLayout.createSequentialGroup()
.addComponent(chkDebug)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(chkCancelWrapper)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(chkNoJVMArgs))
.addComponent(lblServerIP))
.addGap(0, 0, Short.MAX_VALUE))
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, pnlAdvancedSettingsLayout.createSequentialGroup()
.addGroup(pnlAdvancedSettingsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(lblMinecraftArgs)
.addComponent(lblPermSize)
.addComponent(lblJavaArgs))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(pnlAdvancedSettingsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(txtJavaArgs)
.addComponent(txtMinecraftArgs)
.addComponent(txtPermSize, javax.swing.GroupLayout.Alignment.TRAILING))))
.addGap(0, 0, 0))
.addContainerGap()
.addComponent(chkNoJVMArgs)
.addGap(0, 0, Short.MAX_VALUE))
);
pnlAdvancedSettingsLayout.setVerticalGroup(
pnlAdvancedSettingsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
@@ -624,6 +621,10 @@ public final class GameSettingsPanel extends AnimatedPanel implements DropTarget
.addComponent(txtPermSize, javax.swing.GroupLayout.PREFERRED_SIZE, 26, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(lblPermSize))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(lblPrecalledCommand1)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(txtWrapperLauncher, javax.swing.GroupLayout.PREFERRED_SIZE, 26, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(lblPrecalledCommand)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(txtPrecalledCommand, javax.swing.GroupLayout.PREFERRED_SIZE, 26, javax.swing.GroupLayout.PREFERRED_SIZE)
@@ -631,11 +632,8 @@ public final class GameSettingsPanel extends AnimatedPanel implements DropTarget
.addComponent(lblServerIP)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(txtServerIP, javax.swing.GroupLayout.PREFERRED_SIZE, 26, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 46, Short.MAX_VALUE)
.addGroup(pnlAdvancedSettingsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(chkDebug)
.addComponent(chkNoJVMArgs)
.addComponent(chkCancelWrapper))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 168, Short.MAX_VALUE)
.addComponent(chkNoJVMArgs)
.addContainerGap())
);
@@ -697,7 +695,7 @@ public final class GameSettingsPanel extends AnimatedPanel implements DropTarget
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(btnRemoveMod)
.addGap(0, 0, Short.MAX_VALUE))
.addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 254, Short.MAX_VALUE))
.addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 428, Short.MAX_VALUE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(lblModInfo))
);
@@ -930,7 +928,7 @@ public final class GameSettingsPanel extends AnimatedPanel implements DropTarget
.addContainerGap())
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
.addContainerGap(402, Short.MAX_VALUE)
.addContainerGap(576, Short.MAX_VALUE)
.addComponent(btnIncludeMinecraft)
.addContainerGap()))
);
@@ -975,7 +973,7 @@ public final class GameSettingsPanel extends AnimatedPanel implements DropTarget
private void btnDownloadAllAssetsActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnDownloadAllAssetsActionPerformed
if (mcVersion != null)
Settings.getLastProfile().service().asset().downloadAssets(mcVersion).run();
TaskWindow.execute(Settings.getLastProfile().service().asset().downloadAssets(mcVersion));
}//GEN-LAST:event_btnDownloadAllAssetsActionPerformed
private void txtGameDirFocusLost(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_txtGameDirFocusLost
@@ -1116,16 +1114,6 @@ public final class GameSettingsPanel extends AnimatedPanel implements DropTarget
Settings.getLastProfile().getSelectedVersionSetting().setFullscreen(chkFullscreen.isSelected());
}//GEN-LAST:event_chkFullscreenItemStateChanged
private void chkDebugItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_chkDebugItemStateChanged
if (!isLoading)
Settings.getLastProfile().getSelectedVersionSetting().setDebug(chkDebug.isSelected());
}//GEN-LAST:event_chkDebugItemStateChanged
private void chkCancelWrapperItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_chkCancelWrapperItemStateChanged
if (!isLoading)
Settings.getLastProfile().getSelectedVersionSetting().setCanceledWrapper(chkCancelWrapper.isSelected());
}//GEN-LAST:event_chkCancelWrapperItemStateChanged
private void chkNoJVMArgsItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_chkNoJVMArgsItemStateChanged
if (!isLoading)
Settings.getLastProfile().getSelectedVersionSetting().setNoJVMArgs(chkNoJVMArgs.isSelected());
@@ -1167,6 +1155,10 @@ public final class GameSettingsPanel extends AnimatedPanel implements DropTarget
Settings.getLastProfile().getSelectedVersionSetting().setServerIp(txtServerIP.getText());
}//GEN-LAST:event_txtServerIPFocusLost
private void txtWrapperLauncherFocusLost(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_txtWrapperLauncherFocusLost
Settings.getLastProfile().getSelectedVersionSetting().setWrapper(txtWrapperLauncher.getText());
}//GEN-LAST:event_txtWrapperLauncherFocusLost
// </editor-fold>
// <editor-fold defaultstate="collapsed" desc="Load">
void prepareVersionSetting(VersionSetting profile) {
@@ -1181,10 +1173,8 @@ public final class GameSettingsPanel extends AnimatedPanel implements DropTarget
txtMinecraftArgs.setText(profile.getMinecraftArgs());
txtPrecalledCommand.setText(profile.getPrecalledCommand());
txtServerIP.setText(profile.getServerIp());
chkDebug.setSelected(profile.isDebug());
chkNoJVMArgs.setSelected(profile.isNoJVMArgs());
chkFullscreen.setSelected(profile.isFullscreen());
chkCancelWrapper.setSelected(profile.isCanceledWrapper());
cboLauncherVisibility.setSelectedIndex(profile.getLauncherVisibility().ordinal());
cboRunDirectory.setSelectedIndex(profile.getGameDirType().ordinal());
cboJava.setSelectedIndex(profile.getJavaIndexInAllJavas());
@@ -1334,8 +1324,6 @@ public final class GameSettingsPanel extends AnimatedPanel implements DropTarget
private javax.swing.JComboBox cboProfiles;
private javax.swing.JComboBox cboRunDirectory;
private javax.swing.JComboBox cboVersions;
private javax.swing.JCheckBox chkCancelWrapper;
private javax.swing.JCheckBox chkDebug;
private javax.swing.JCheckBox chkFullscreen;
private javax.swing.JCheckBox chkNoJVMArgs;
private javax.swing.JScrollPane jScrollPane1;
@@ -1351,6 +1339,7 @@ public final class GameSettingsPanel extends AnimatedPanel implements DropTarget
private javax.swing.JLabel lblModInfo;
private javax.swing.JLabel lblPermSize;
private javax.swing.JLabel lblPrecalledCommand;
private javax.swing.JLabel lblPrecalledCommand1;
private javax.swing.JLabel lblProfile;
private javax.swing.JLabel lblRunDirectory;
private javax.swing.JLabel lblServerIP;
@@ -1377,6 +1366,7 @@ public final class GameSettingsPanel extends AnimatedPanel implements DropTarget
private javax.swing.JTextField txtPrecalledCommand;
private javax.swing.JTextField txtServerIP;
private javax.swing.JTextField txtWidth;
private javax.swing.JTextField txtWrapperLauncher;
// End of variables declaration//GEN-END:variables
private javax.swing.JPanel pnlGameDownloads;
@@ -1386,10 +1376,12 @@ public final class GameSettingsPanel extends AnimatedPanel implements DropTarget
final Runnable onLoadingProfiles = this::loadProfiles;
private void loadProfiles() {
isLoading = true;
DefaultComboBoxModel model = new DefaultComboBoxModel();
for (Profile s : Settings.getProfilesFiltered())
model.addElement(s.getName());
cboProfiles.setModel(model);
isLoading = false;
}
final Consumer<IMinecraftService> onRefreshedVersions = t -> {
@@ -1435,12 +1427,15 @@ public final class GameSettingsPanel extends AnimatedPanel implements DropTarget
t.selectedVersionChangedEvent.register(selectedVersionChangedEvent);
txtGameDir.setText(t.getGameDir());
isLoading = true;
DefaultComboBoxModel model = (DefaultComboBoxModel) cboProfiles.getModel();
for (int i = 0; i < model.getSize(); ++i)
if (model.getElementAt(i).equals(t.getName())) {
model.setSelectedItem(t.getName());
break;
}
isLoading = false;
};
//</editor-fold>
}
@@ -17,6 +17,7 @@
*/
package org.jackhuang.hellominecraft.launcher.ui;
import java.io.File;
import java.io.IOException;
import java.util.List;
import javax.swing.JOptionPane;
@@ -25,11 +26,13 @@ import org.jackhuang.hellominecraft.launcher.core.launch.GameLauncher;
import org.jackhuang.hellominecraft.launcher.core.launch.LaunchingState;
import org.jackhuang.hellominecraft.launcher.setting.Profile;
import org.jackhuang.hellominecraft.launcher.setting.Settings;
import org.jackhuang.hellominecraft.launcher.util.MinecraftCrashAdvicer;
import org.jackhuang.hellominecraft.util.C;
import org.jackhuang.hellominecraft.util.Event;
import org.jackhuang.hellominecraft.util.MessageBox;
import org.jackhuang.hellominecraft.util.func.Consumer;
import org.jackhuang.hellominecraft.util.logging.HMCLog;
import org.jackhuang.hellominecraft.util.system.FileUtils;
import org.jackhuang.hellominecraft.util.system.JavaProcessMonitor;
import org.jackhuang.hellominecraft.util.ui.LogWindow;
import org.jackhuang.hellominecraft.util.ui.WebFrame;
@@ -95,8 +98,21 @@ public class LaunchingUIDaemon {
JavaProcessMonitor jpm = new JavaProcessMonitor(p);
jpm.applicationExitedAbnormallyEvent.register(t -> {
HMCLog.err("The game exited abnormally, exit code: " + t);
MessageBox.Show(C.i18n("launch.exited_abnormally") + " exit code: " + t);
WebFrame f = new WebFrame(jpm.getJavaProcess().getStdOutLines().toArray(new String[0]));
String[] logs = jpm.getJavaProcess().getStdOutLines().toArray(new String[0]);
String errorText = null;
for (String s : logs) {
int pos = s.lastIndexOf("#@!@#");
if (pos >= 0 && pos < s.length() - "#@!@#".length() - 1) {
errorText = s.substring(pos + "#@!@#".length()).trim();
break;
}
}
String msg = C.i18n("launch.exited_abnormally") + " exit code: " + t;
if (errorText != null)
msg += ", advice: " + MinecraftCrashAdvicer.getAdvice(FileUtils.readFileToStringQuietly(new File(errorText)));
MessageBox.Show(msg);
WebFrame f = new WebFrame(logs);
f.setModal(true);
f.setTitle("Game output");
f.setVisible(true);
checkExit((LauncherVisibility) obj.getTag());
@@ -105,6 +121,7 @@ public class LaunchingUIDaemon {
HMCLog.err("Cannot create jvm, exit code: " + t);
MessageBox.Show(C.i18n("launch.cannot_create_jvm") + " exit code: " + t);
WebFrame f = new WebFrame(jpm.getJavaProcess().getStdOutLines().toArray(new String[0]));
f.setModal(true);
f.setTitle("Game output");
f.setVisible(true);
checkExit((LauncherVisibility) obj.getTag());
@@ -121,9 +138,15 @@ public class LaunchingUIDaemon {
return true;
};
private static void getCrashReport() {
}
private static void checkExit(LauncherVisibility v) {
if (v != LauncherVisibility.KEEP && !LogWindow.INSTANCE.isVisible())
if (v != LauncherVisibility.KEEP && !LogWindow.INSTANCE.isVisible()) {
HMCLog.log("Launcher will exit now.");
System.exit(0);
}
}
private static final Event<List<String>> LAUNCH_SCRIPT_FINISHER = (sender, str) -> {
@@ -258,7 +258,7 @@
<Component class="javax.swing.JButton" name="btnImportModpack">
<Properties>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="org/jackhuang/hellominecraft/lang/I18N.properties" key="modpack.install.task" replaceFormat="C.i18n(&quot;{key}&quot;)"/>
<ResourceString bundle="org/jackhuang/hellominecraft/lang/I18N.properties" key="modpack.task.install" replaceFormat="C.i18n(&quot;{key}&quot;)"/>
</Property>
</Properties>
<Events>
@@ -268,7 +268,7 @@
<Component class="javax.swing.JButton" name="btnExportModpack">
<Properties>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="org/jackhuang/hellominecraft/lang/I18N.properties" key="modpack.save.task" replaceFormat="C.i18n(&quot;{key}&quot;)"/>
<ResourceString bundle="org/jackhuang/hellominecraft/lang/I18N.properties" key="modpack.task.save" replaceFormat="C.i18n(&quot;{key}&quot;)"/>
</Property>
</Properties>
<Events>
@@ -37,6 +37,7 @@ import org.jackhuang.hellominecraft.launcher.setting.Settings;
import org.jackhuang.hellominecraft.launcher.core.mod.ModpackManager;
import org.jackhuang.hellominecraft.launcher.core.service.IMinecraftService;
import org.jackhuang.hellominecraft.launcher.ui.modpack.ModpackWizard;
import org.jackhuang.hellominecraft.launcher.util.HMCLMinecraftService;
import org.jackhuang.hellominecraft.util.ui.GraphicsUtils;
import org.jackhuang.hellominecraft.util.Event;
import org.jackhuang.hellominecraft.lookandfeel.comp.ConstomButton;
@@ -233,14 +234,14 @@ public class MainPagePanel extends AnimatedPanel {
pnlPassword.add(jPanel3, "card3");
btnImportModpack.setText(C.i18n("modpack.install.task")); // NOI18N
btnImportModpack.setText(C.i18n("modpack.task.install")); // NOI18N
btnImportModpack.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnImportModpackActionPerformed(evt);
}
});
btnExportModpack.setText(C.i18n("modpack.save.task")); // NOI18N
btnExportModpack.setText(C.i18n("modpack.task.save")); // NOI18N
btnExportModpack.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnExportModpackActionPerformed(evt);
@@ -382,7 +383,7 @@ public class MainPagePanel extends AnimatedPanel {
if (fc.getSelectedFile() == null)
return;
String suggestedModpackId = JOptionPane.showInputDialog("Please enter your favourite game name", FileUtils.getBaseName(fc.getSelectedFile().getName()));
TaskWindow.factory().append(ModpackManager.install(fc.getSelectedFile(), Settings.getLastProfile().service(), suggestedModpackId)).create();
TaskWindow.factory().append(ModpackManager.install(MainFrame.INSTANCE, fc.getSelectedFile(), Settings.getLastProfile().service(), suggestedModpackId)).create();
Settings.getLastProfile().service().version().refreshVersions();
}//GEN-LAST:event_btnImportModpackActionPerformed
@@ -471,10 +472,12 @@ public class MainPagePanel extends AnimatedPanel {
final Runnable onLoadingProfiles = this::loadProfiles;
private void loadProfiles() {
isLoading = true;
DefaultComboBoxModel model = new DefaultComboBoxModel();
for (Profile s : Settings.getProfilesFiltered())
model.addElement(s.getName());
cboProfiles.setModel(model);
isLoading = false;
}
final Consumer<IMinecraftService> onRefreshedVersions = t -> {
@@ -489,7 +492,7 @@ public class MainPagePanel extends AnimatedPanel {
cboVersions.removeAllItems();
String selVersion = Settings.getLastProfile().getSelectedVersion();
if (Settings.getLastProfile().service().version().getVersions().isEmpty()) {
if (!showedNoVersion) {
if (!showedNoVersion && ((HMCLMinecraftService) Settings.getLastProfile().service()).checkedModpack) {
showedNoVersion = true;
SwingUtilities.invokeLater(() -> {
if (MessageBox.Show(C.i18n("mainwindow.no_version"), MessageBox.YES_NO_OPTION) == MessageBox.YES_OPTION)
@@ -528,11 +531,13 @@ public class MainPagePanel extends AnimatedPanel {
t.selectedVersionChangedEvent.register(versionChanged);
t.launcher().launchingStateChanged.register(launchingStateChanged);
isLoading = true;
DefaultComboBoxModel model = (DefaultComboBoxModel) cboProfiles.getModel();
for (int i = 0; i < model.getSize(); ++i)
if (model.getElementAt(i).equals(t.getName())) {
model.setSelectedItem(t.getName());
break;
}
isLoading = false;
};
}
@@ -46,7 +46,7 @@
<Group type="102" alignment="0" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Component id="jLabel1" min="-2" max="-2" attributes="0"/>
<EmptySpace pref="61" max="32767" attributes="0"/>
<EmptySpace pref="19" max="32767" attributes="0"/>
<Component id="jLabel2" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="txtModpackName" min="-2" max="-2" attributes="0"/>
@@ -72,7 +72,7 @@
<Component class="javax.swing.JLabel" name="lblModpackLocation">
<Properties>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="org/jackhuang/hellominecraft/lang/I18N.properties" key="modpack.save" replaceFormat="C.i18n(&quot;{key}&quot;)"/>
<ResourceString bundle="org/jackhuang/hellominecraft/lang/I18N.properties" key="modpack.wizard.step.initialization.save" replaceFormat="C.i18n(&quot;{key}&quot;)"/>
</Property>
</Properties>
</Component>
@@ -91,7 +91,9 @@
</Component>
<Component class="javax.swing.JLabel" name="lblGameVersion">
<Properties>
<Property name="text" type="java.lang.String" value="&#x8981;&#x5bfc;&#x51fa;&#x7684;&#x6e38;&#x620f;&#x7248;&#x672c;"/>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="org/jackhuang/hellominecraft/lang/I18N.properties" key="modpack.wizard.step.initialization.exported_version" replaceFormat="C.i18n(&quot;{key}&quot;)"/>
</Property>
</Properties>
</Component>
<Component class="javax.swing.JComboBox" name="cboGameVersion">
@@ -110,7 +112,7 @@
<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/hellominecraft/launcher/I18N.properties" key="modpack.warning" replaceFormat="C.i18n(&quot;{key}&quot;)"/>
<ResourceString bundle="org/jackhuang/hellominecraft/lang/I18N.properties" key="modpack.wizard.step.initialization.warning" replaceFormat="C.i18n(&quot;{key}&quot;)"/>
</Property>
</Properties>
</Component>
@@ -131,7 +133,9 @@
</Component>
<Component class="javax.swing.JCheckBox" name="chkIncludeLauncher">
<Properties>
<Property name="text" type="java.lang.String" value="&#x5305;&#x542b;&#x542f;&#x52a8;&#x5668;"/>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="org/jackhuang/hellominecraft/lang/I18N.properties" key="modpack.wizard.step.initialization.include_launcher" replaceFormat="C.i18n(&quot;{key}&quot;)"/>
</Property>
</Properties>
<Events>
<EventHandler event="itemStateChanged" listener="java.awt.event.ItemListener" parameters="java.awt.event.ItemEvent" handler="chkIncludeLauncherItemStateChanged"/>
@@ -82,7 +82,7 @@ public class ModpackInitializationPanel extends javax.swing.JPanel {
txtModpackName = new javax.swing.JTextField();
chkIncludeLauncher = new javax.swing.JCheckBox();
lblModpackLocation.setText(C.i18n("modpack.save")); // NOI18N
lblModpackLocation.setText(C.i18n("modpack.wizard.step.initialization.save")); // NOI18N
txtModpackLocation.addCaretListener(new javax.swing.event.CaretListener() {
public void caretUpdate(javax.swing.event.CaretEvent evt) {
@@ -97,7 +97,7 @@ public class ModpackInitializationPanel extends javax.swing.JPanel {
}
});
lblGameVersion.setText("要导出的游戏版本");
lblGameVersion.setText(C.i18n("modpack.wizard.step.initialization.exported_version")); // NOI18N
cboGameVersion.addItemListener(new java.awt.event.ItemListener() {
public void itemStateChanged(java.awt.event.ItemEvent evt) {
@@ -105,7 +105,7 @@ public class ModpackInitializationPanel extends javax.swing.JPanel {
}
});
jLabel1.setText(C.i18n("modpack.warning")); // NOI18N
jLabel1.setText(C.i18n("modpack.wizard.step.initialization.warning")); // NOI18N
jLabel2.setText(C.i18n("modpack.name")); // NOI18N
@@ -116,7 +116,7 @@ public class ModpackInitializationPanel extends javax.swing.JPanel {
}
});
chkIncludeLauncher.setText("包含启动器");
chkIncludeLauncher.setText(C.i18n("modpack.wizard.step.initialization.include_launcher")); // NOI18N
chkIncludeLauncher.addItemListener(new java.awt.event.ItemListener() {
public void itemStateChanged(java.awt.event.ItemEvent evt) {
chkIncludeLauncherItemStateChanged(evt);
@@ -140,7 +140,7 @@ public class ModpackInitializationPanel extends javax.swing.JPanel {
.addGroup(layout.createSequentialGroup()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(lblGameVersion)
.addComponent(jLabel1)
.addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel2)
.addComponent(chkIncludeLauncher))
.addGap(0, 0, Short.MAX_VALUE)))
@@ -150,8 +150,8 @@ public class ModpackInitializationPanel extends javax.swing.JPanel {
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addComponent(jLabel1)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 61, Short.MAX_VALUE)
.addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 19, Short.MAX_VALUE)
.addComponent(jLabel2)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(txtModpackName, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
@@ -174,7 +174,7 @@ public class ModpackInitializationPanel extends javax.swing.JPanel {
private void cboModpackLocationActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cboModpackLocationActionPerformed
JFileChooser fc = new JFileChooser();
fc.setFileSelectionMode(JFileChooser.FILES_ONLY);
fc.setDialogTitle(C.i18n("modpack.save"));
fc.setDialogTitle(C.i18n("modpack.wizard.step.initialization.save"));
fc.setMultiSelectionEnabled(false);
fc.setFileFilter(new FileNameExtensionFilter(C.i18n("modpack") + "(*.zip)", "zip"));
fc.showSaveDialog(this);
@@ -100,7 +100,10 @@ public class ModpackWizard extends WizardBranchController {
}
try {
String gameVersion = (String) settings.get(ModpackInitializationPanel.KEY_GAME_VERSION);
File loc = new File((String) settings.get(ModpackInitializationPanel.KEY_MODPACK_LOCATION));
String strLocation = (String) settings.get(ModpackInitializationPanel.KEY_MODPACK_LOCATION);
if (!strLocation.endsWith(".zip"))
strLocation += ".zip";
File loc = new File(strLocation);
File modpack = loc;
if ((Boolean) settings.get(ModpackInitializationPanel.KEY_INCLUDING_LAUNCHER))
modpack = new File(loc.getAbsolutePath() + ".temp");
@@ -178,8 +181,7 @@ public class ModpackWizard extends WizardBranchController {
throw new IllegalArgumentException(id);
}
}
}
);
});
}
@Override
@@ -48,7 +48,8 @@ public class CrashReporter implements Thread.UncaughtExceptionHandler {
put("MessageBox", "");
put("AWTError", "");
put("JFileChooser", "Has your operating system been installed completely or is a ghost system? ");
put("JceSecurityManager", "Has your operating system been installed completely or is a ghost system? ");
put("JceSecurity", "Has your operating system been installed completely or is a ghost system? ");
put("couldn't create component peer", "Fucking computer!");
put("sun.awt.shell.Win32ShellFolder2", "crash.user_fault");
put("UnsatisfiedLinkError", "crash.user_fault");
put("java.awt.HeadlessException", "crash.headless");
@@ -58,6 +59,7 @@ public class CrashReporter implements Thread.UncaughtExceptionHandler {
put("java.lang.IncompatibleClassChangeError", "crash.NoClassDefFound");
put("java.lang.ClassFormatError", "crash.NoClassDefFound");
put("java.lang.OutOfMemoryError", "FUCKING MEMORY LIMIT!");
put("Trampoline", "ui.message.update_java");
}
};
@@ -21,6 +21,7 @@ import com.google.gson.JsonSyntaxException;
import java.io.File;
import java.util.HashMap;
import java.util.Map;
import javax.swing.SwingUtilities;
import org.jackhuang.hellominecraft.launcher.core.GameException;
import org.jackhuang.hellominecraft.launcher.core.install.MinecraftInstallerService;
import org.jackhuang.hellominecraft.launcher.core.asset.MinecraftAssetService;
@@ -39,6 +40,7 @@ import org.jackhuang.hellominecraft.launcher.core.mod.MinecraftModService;
import org.jackhuang.hellominecraft.launcher.core.mod.ModpackManager;
import org.jackhuang.hellominecraft.launcher.setting.Profile;
import org.jackhuang.hellominecraft.launcher.setting.VersionSetting;
import org.jackhuang.hellominecraft.launcher.ui.MainFrame;
import org.jackhuang.hellominecraft.util.C;
import org.jackhuang.hellominecraft.util.logging.HMCLog;
import org.jackhuang.hellominecraft.util.system.FileUtils;
@@ -66,12 +68,19 @@ public class HMCLMinecraftService extends IMinecraftService {
this.mis = new MinecraftInstallerService(this);
}
public boolean checkedModpack = false, checkingModpack = false;
private void checkModpack() {
if (version().getVersionCount() == 0) {
File modpack = new File("modpack.zip");
if (modpack.exists()) {
TaskWindow.factory().append(ModpackManager.install(modpack, this, null)).create();
version().refreshVersions();
if (!checkingModpack) {
checkingModpack = true;
if (version().getVersionCount() == 0) {
File modpack = new File("modpack.zip");
if (modpack.exists())
SwingUtilities.invokeLater(() -> {
if (TaskWindow.execute(ModpackManager.install(MainFrame.INSTANCE, modpack, this, null)))
version().refreshVersions();
checkedModpack = true;
});
}
}
}
@@ -32,6 +32,8 @@ public final class MinecraftCrashAdvicer {
}
public static String getAdvice(String trace, boolean selfCrash) {
if (trace == null)
return C.i18n("crash.advice.no");
trace = trace.toLowerCase(SupportedLocales.NOW_LOCALE.self);
if (trace.contains("pixel format not accelerated"))
return C.i18n("crash.advice.LWJGLException");
@@ -125,6 +125,8 @@ public class IOUtils {
}
public static boolean isAbsolutePath(String path) {
if (path == null)
return true;
return path.startsWith("/") || path.indexOf(":") > 0;
}
@@ -44,6 +44,13 @@ public class Java {
JAVA = Collections.unmodifiableList(temp);
}
public static Java suggestedJava() {
for (Java j : JAVA)
if (j.name.startsWith("1.8") || j.name.startsWith("9"))
return j;
return JAVA.get(0);
}
String name, home;
public Java(String name, String home) {
@@ -66,6 +66,14 @@ public class ProcessThread extends Thread {
line = "";
} else
line += (char) ch;
while ((ch = br.read()) != -1)
if (ch == '\n') {
printlnEvent.execute(line);
System.out.println("Minecraft: " + line);
p.getStdOutLines().add(line);
line = "";
} else
line += (char) ch;
stopEvent.execute(p);
} catch (Exception e) {
HMCLog.err("An error occured when reading process stdout/stderr.", e);
@@ -100,6 +100,8 @@ public class ZipEngine {
zos.putNextEntry(new ZipEntry(pathName));
putDirectoryImpl(file, basePath, pathNameCallback);
} else {
if (".DS_Store".equals(file.getName())) // For mac computers.
continue;
pathName = file.getPath().substring(basePath.length() + 1);
if (pathNameCallback != null)
pathName = pathNameCallback.apply(pathName, false);
@@ -0,0 +1,29 @@
/*
* Hello Minecraft! Launcher.
* Copyright (C) 2013 huangyuhui <huanghongxun2008@126.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see {http://www.gnu.org/licenses/}.
*/
package org.jackhuang.hellominecraft.util.tasks;
/**
*
* @author huangyuhui
*/
public class NoShownTaskException extends RuntimeException {
public NoShownTaskException(String msg) {
super(msg);
}
}
@@ -95,6 +95,8 @@ public abstract class Task {
return null;
}
public boolean areDependTasksSucceeded;
protected ProgressProviderListener ppl;
public Task setProgressProviderListener(ProgressProviderListener p) {
@@ -110,9 +112,21 @@ public abstract class Task {
return new DoubleTask(t, this);
}
public void runWithException() throws Throwable {
Collection<Task> c = getDependTasks();
if (c != null)
for (Task t : c)
t.runWithException();
executeTask();
c = getAfterTasks();
if (c != null)
for (Task t : c)
t.runWithException();
}
public boolean run() {
try {
executeTask();
runWithException();
return true;
} catch (Throwable t) {
HMCLog.err("Failed to execute task", t);
@@ -24,10 +24,11 @@ import java.util.HashMap;
import java.util.HashSet;
import java.util.LinkedList;
import java.util.List;
import java.util.Set;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.Future;
import java.util.concurrent.atomic.AtomicBoolean;
import org.jackhuang.hellominecraft.util.logging.HMCLog;
/**
@@ -71,17 +72,20 @@ public class TaskList extends Thread {
private class Invoker implements Runnable {
Task task;
Set<Invoker> s;
CountDownLatch latch;
AtomicBoolean bool;
public Invoker(Task task, Set<Invoker> ss) {
public Invoker(Task task, CountDownLatch latch, AtomicBoolean bool) {
this.task = task;
s = ss;
this.latch = latch;
this.bool = bool;
}
@Override
public void run() {
executeTask(task);
s.remove(this);
if (!executeTask(task))
bool.set(false);
latch.countDown();
}
}
@@ -90,32 +94,31 @@ public class TaskList extends Thread {
HashMap<Invoker, Future<?>> futures = new HashMap<>();
HashSet<Invoker> invokers = new HashSet<>();
private void processTasks(Collection<? extends Task> c) {
private boolean processTasks(Collection<? extends Task> c) {
if (c == null || c.isEmpty())
return;
return true;
this.totTask += c.size();
Set<Invoker> runningThread = Collections.synchronizedSet(new HashSet<Invoker>());
AtomicBoolean bool = new AtomicBoolean(true);
CountDownLatch counter = new CountDownLatch(c.size());
for (Task t2 : c) {
t2.setParallelExecuting(true);
Invoker thread = new Invoker(t2, runningThread);
runningThread.add(thread);
Invoker thread = new Invoker(t2, counter, bool);
invokers.add(thread);
if (!EXECUTOR_SERVICE.isTerminated())
if (!EXECUTOR_SERVICE.isShutdown() && !EXECUTOR_SERVICE.isTerminated())
futures.put(thread, EXECUTOR_SERVICE.submit(thread));
}
while (!runningThread.isEmpty())
try {
if (this.isInterrupted())
return;
Thread.sleep(1);
} catch (InterruptedException ignore) {
}
try {
counter.await();
} catch (InterruptedException ignore) {
}
return bool.get();
}
private void executeTask(Task t) {
if (!shouldContinue || t == null)
return;
private boolean executeTask(Task t) {
if (!shouldContinue)
return false;
if (t == null)
return true;
Collection<Task> c = t.getDependTasks();
if (c == null)
@@ -125,7 +128,7 @@ public class TaskList extends Thread {
d.onDoing(t, c);
for (DoingDoneListener<Task> d : taskListener)
d.onDoing(t, c);
processTasks(c);
t.areDependTasksSucceeded = processTasks(c);
boolean flag = true;
try {
@@ -151,6 +154,7 @@ public class TaskList extends Thread {
for (DoingDoneListener<Task> d : t.getTaskListeners())
d.onFailed(t);
}
return flag;
}
@Override
@@ -176,7 +180,7 @@ public class TaskList extends Thread {
while (!in.isEmpty())
synchronized (in) {
Invoker it = in.iterator().next();
if (!it.task.abort())
if (!it.task.abort() && futures.get(it) != null)
futures.get(it).cancel(true);
in.remove(it);
}
@@ -225,9 +225,11 @@ public class TaskWindow extends javax.swing.JDialog
@Override
public void run() {
SwingUtilities.invokeLater(this::dispose);
suc = true;
HMCLog.log("Tasks are finished.");
SwingUtilities.invokeLater(() -> {
dispose();
suc = true;
HMCLog.log("Tasks are finished.");
});
}
@Override
@@ -271,7 +273,14 @@ public class TaskWindow extends javax.swing.JDialog
SwingUtilities.invokeLater(() -> {
if (taskList == null || task == null)
return;
failReasons.add(task.getInfo() + ": " + (null == task.getFailReason() ? "No exception" : (StrUtils.isBlank(task.getFailReason().getLocalizedMessage()) ? task.getFailReason().getClass().getSimpleName() : task.getFailReason().getLocalizedMessage())));
String msg = null;
if (task.getFailReason() != null && !(task.getFailReason() instanceof NoShownTaskException))
if (StrUtils.isBlank(task.getFailReason().getLocalizedMessage()))
msg = task.getFailReason().getClass().getSimpleName();
else
msg = task.getFailReason().getLocalizedMessage();
if (msg != null)
failReasons.add(task.getInfo() + ": " + msg);
pgsTotal.setMaximum(taskList.taskCount());
pgsTotal.setValue(pgsTotal.getValue() + 1);
int idx = tasks.indexOf(task);
@@ -118,8 +118,7 @@ public class FileDownloadTask extends Task implements PreviousResult<File>, Prev
this.url = IOUtils.parseURL(p.getResult());
for (int repeat = 0; repeat < 6; repeat++) {
if (repeat > 0) {
HMCLog.warn("Failed to download, repeat: " + repeat);
if (repeat > 0)
if (failedCallbackReturnsNewURL != null) {
URL tmp = IOUtils.parseURL(failedCallbackReturnsNewURL.apply(repeat));
if (tmp != null) {
@@ -127,7 +126,7 @@ public class FileDownloadTask extends Task implements PreviousResult<File>, Prev
HMCLog.warn("Switch to: " + url);
}
}
}
HMCLog.log("Downloading: " + url + ", to: " + filePath);
if (!shouldContinue)
break;
try {
@@ -21,6 +21,7 @@ import java.awt.Component;
import java.awt.EventQueue;
import java.awt.FontMetrics;
import java.awt.Frame;
import java.awt.Window;
import java.io.File;
import java.io.IOException;
import java.net.URI;
@@ -279,13 +280,13 @@ public class SwingUtils {
component.setEnabled(t);
}
public static void exitIfNoWindow(Frame thisFrame) {
public static void exitIfNoWindow(Window thisFrame) {
exitIfNoWindow(thisFrame, false);
}
public static void exitIfNoWindow(Frame thisFrame, boolean neededDispose) {
public static void exitIfNoWindow(Window thisFrame, boolean neededDispose) {
boolean flag = false;
for (Frame f : Frame.getFrames()) {
for (Window f : Window.getWindows()) {
if (f == thisFrame)
continue;
if (f.isVisible())
@@ -17,13 +17,9 @@
*/
package org.jackhuang.hellominecraft.util.ui;
import java.awt.Frame;
import java.awt.HeadlessException;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.awt.event.WindowListener;
import java.util.List;
import javax.swing.JFrame;
import javax.swing.JDialog;
import org.jackhuang.hellominecraft.util.StrUtils;
import org.jackhuang.hellominecraft.util.logging.Level;
@@ -31,14 +27,15 @@ import org.jackhuang.hellominecraft.util.logging.Level;
*
* @author huangyuhui
*/
public class WebFrame extends JFrame {
public class WebFrame extends JDialog {
public WebFrame(String... strs) {
this(("<html>" + StrUtils.parseParams(t -> ("<font color='#" + GraphicsUtils.getColor(Level.guessLevel((String) t, Level.INFO).COLOR) + "'>"), strs, t -> "</font><br />") + "</html>")
.replace(" ", "&nbsp;").replace("\t", "&nbsp;&nbsp;&nbsp;&nbsp;"));
}
public WebFrame(String content) throws HeadlessException {
public WebFrame(String content) {
super((JDialog) null, false);
addWindowListener(new WindowAdapter() {
@Override
public void windowClosing(WindowEvent e) {
@@ -64,16 +64,18 @@ public class NavProgress implements ResultProgressHandle {
public void setProgress(final int currentStep, final int totalSteps) {
invoke(() -> {
if (totalSteps == -1)
progressBar.setIndeterminate(true);
else {
if (totalSteps == -1) {
if (!progressBar.isIndeterminate())
progressBar.setIndeterminate(true);
} else {
if (currentStep > totalSteps || currentStep < 0) {
if (currentStep == -1 && totalSteps == -1)
return;
throw new IllegalArgumentException("Bad step values: "
+ currentStep + " out of " + totalSteps);
}
progressBar.setIndeterminate(false);
if (progressBar.isIndeterminate())
progressBar.setIndeterminate(false);
progressBar.setMaximum(totalSteps);
progressBar.setValue(currentStep);
}
@@ -83,8 +85,8 @@ public class NavProgress implements ResultProgressHandle {
public void setBusy(final String description) {
invoke(() -> {
lbl.setText(description == null ? " " : description);
progressBar.setIndeterminate(true);
if (!progressBar.isIndeterminate())
progressBar.setIndeterminate(true);
});
}
@@ -27,6 +27,7 @@ import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.IllegalComponentStateException;
import java.awt.Insets;
import java.awt.RenderingHints;
import java.awt.image.BufferedImage;
import java.io.IOException;
import java.util.Locale;
@@ -159,6 +160,8 @@ public class InstructionsPanelImpl extends JComponent implements WizardObserver,
public final void paintComponent(Graphics g) {
Graphics2D g2d = (Graphics2D) g;
g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
Font f = getFont() != null ? getFont() : UIManager.getFont("controlFont");
FontMetrics fm = g.getFontMetrics(f);
Insets ins = getInsets();
@@ -185,7 +188,6 @@ public class InstructionsPanelImpl extends JComponent implements WizardObserver,
int h = fm.getMaxAscent() + fm.getMaxDescent() + 3;
Font boldFont = f.deriveFont(Font.BOLD);
g.setFont(boldFont);
g.drawString(C.i18n("wizard.steps"), x, y);
@@ -36,7 +36,7 @@ import javax.swing.JTextArea;
* SimpleWizard created for it, acting as the WizardController for
* calls to WizardPanelProvider.createPanel().
*/
final class SimpleWizardInfo implements WizardControllerImplementation {
public final class SimpleWizardInfo implements WizardControllerImplementation {
private WeakReference wizard = null;
private final String[] descriptions;
@@ -318,4 +318,8 @@ final class SimpleWizardInfo implements WizardControllerImplementation {
boolean cancel(Map settings) {
return provider.cancel(settings);
}
public WizardPanelProvider getProvider() {
return provider;
}
}
@@ -8,113 +8,123 @@ and include the License file at http://www.netbeans.org/cddl.txt.
If applicable, add the following below the CDDL Header, with the fields
enclosed by brackets [] replaced by your own identifying information:
"Portions Copyrighted [year] [name of copyright owner]" */
/*
/*
* WizardBranchController.java
*
* Created on March 5, 2005, 6:33 PM
*/
package org.jackhuang.hellominecraft.util.ui.wizard.spi;
import java.util.Map;
/**
* Extend this class to create wizards which have branch points in them -
* either override <code>getWizardForStep</code> to return one or another a wizard which
* represents the subsequent steps after a decision point, or override
* <code>getPanelProviderForStep</code> to provide instances of <code>WizardPanelProvider</code>
* if there are no subsequent branch points and the continuation is a
* Extend this class to create wizards which have branch points in them -
* either override <code>getWizardForStep</code> to return one or another a
* wizard which
* represents the subsequent steps after a decision point, or override
* <code>getPanelProviderForStep</code> to provide instances of
* <code>WizardPanelProvider</code>
* if there are no subsequent branch points and the continuation is a
* simple wizard.
* <p>
* The basic idea is to supply a base wizard for the initial steps, stopping
* at the branch point. The panel for the branch point should put enough
* information into the settings map that the WizardBranchController can
* at the branch point. The panel for the branch point should put enough
* information into the settings map that the WizardBranchController can
* decide what to return as the remaining steps of the wizard.
* <p>
* The result is a <code>Wizard</code> which embeds sub-wizards; when the
* The result is a <code>Wizard</code> which embeds sub-wizards; when the
* <code>PanelProvider</code> passed to the constructor runs out of steps,
* the master <code>Wizard</code> will try to find a sub-<code>Wizard</code>
* by calling <code>getWizardForStep</code>. If non-null, the user seamlessly
* continues in the returned wizard. To create <code>Wizard</code>s with
* by calling <code>getWizardForStep</code>. If non-null, the user seamlessly
* continues in the returned wizard. To create <code>Wizard</code>s with
* multiple branches, simply override <code>getWizardForStep</code> to create
* another <code>WizardBranchController</code> and return the result of its
* <code>createWizard</code> method.
* <p>
* Note that it is important to cache the instances of <code>WizardPanelProvider</code>
* Note that it is important to cache the instances of
* <code>WizardPanelProvider</code>
* or <code>Wizard</code> which are returned here - this class's methods may
* be called frequently to determine if the sequence of steps (the next wizard)
* have changed.
*
*
* @author Tim Boudreau
*/
public abstract class WizardBranchController {
private final SimpleWizardInfo base;
/**
* Create a new WizardBranchController. The <code>base</code> argument
* Create a new WizardBranchController. The <code>base</code> argument
* provides the initial step(s) of the wizard up; when the user comes to
* the last step of the base wizard, this WizardBranchController will be
* asked for a wizard to provide subsequent panes. So the base wizard
* asked for a wizard to provide subsequent panes. So the base wizard
* should put some token into the settings map based on what the user
* selects on its final pane, which the WizardBranchController can use
* to decide what the next steps should be.
*/
protected WizardBranchController (WizardPanelProvider base) {
this (new SimpleWizardInfo (base));
protected WizardBranchController(WizardPanelProvider base) {
this(new SimpleWizardInfo(base));
}
/**
* Create a new WizardBranchController using the passed WizardPage
* instances as the initial pages of the wizard.
*
* @param pages An array of WizardPage instances
*/
protected WizardBranchController (WizardPage[] pages) {
this (WizardPage.createWizardPanelProvider(pages));
*/
protected WizardBranchController(WizardPage[] pages) {
this(WizardPage.createWizardPanelProvider(pages));
}
/**
* Create a new WizardBranchController using the passed WizardPage
* as the initial page of the wizard. The initial page should
* as the initial page of the wizard. The initial page should
* determine the subsequent steps of the wizard.
*
* @param onlyPage An instance of WizardPage
*/
protected WizardBranchController (WizardPage onlyPage) {
this (WizardPage.createWizardPanelProvider(onlyPage));
}
*/
protected WizardBranchController(WizardPage onlyPage) {
this(WizardPage.createWizardPanelProvider(onlyPage));
}
/**
* Create a new WizardBranchController, using the passed <code>SimpleWizardInfo</code>
* Create a new WizardBranchController, using the passed
* <code>SimpleWizardInfo</code>
* for the initial panes of the wizard.
*/
WizardBranchController (SimpleWizardInfo base) {
if (base == null) throw new NullPointerException ("No base");
WizardBranchController(SimpleWizardInfo base) {
if (base == null)
throw new NullPointerException("No base");
this.base = base;
}
/**
* Get the wizard which represents the subsequent panes after this step.
* The UI for the current step should have put sufficient data into the
* settings map to decide what to return; return null if not.
* settings map to decide what to return; return null if not.
* <p>
* The default implementation delegates to <code>getPanelProviderForStep()</code>
* The default implementation delegates to
* <code>getPanelProviderForStep()</code>
* and returns a <code>Wizard</code> representing the result of that
* call.
* call.
* <p>
* <b>Note:</b> This method can be called very frequently, to determine
* if the sequence of steps has changed - so it needs to run fast.
* Returning the same instance every time the same arguments are passed
* is highly recommended. It will typically be called whenever a change
* <b>Note:</b> This method can be called very frequently, to determine
* if the sequence of steps has changed - so it needs to run fast.
* Returning the same instance every time the same arguments are passed
* is highly recommended. It will typically be called whenever a change
* is fired by the base wizard (i.e. every call <code>setProblem()</code>
* should generate a check to see if the navigation has changed).
* <p>
* Note that the wizard for the subsequent steps will be instantiated
* as soon as it is known what the user's choice is, so the list of
* as soon as it is known what the user's choice is, so the list of
* pending steps can be updated (this does not mean that all subsequent
* panel UI components of the wizard will be instantiated, just the
* Wizard object itself, which will create panels on demand if they
* have not already been created).
*
* @param step The current step the user is on in the wizard
* @param step The current step the user is on in the wizard
* @param settings The settings map, which previous panes of the wizard
* have been writing information into
* have been writing information into
*/
protected Wizard getWizardForStep(String step, Map settings) {
WizardPanelProvider provider = getPanelProviderForStep(step, settings);
@@ -122,42 +132,44 @@ public abstract class WizardBranchController {
}
/**
* Override this method to return a <code>WizardPanelProvider</code> representing the
* Override this method to return a <code>WizardPanelProvider</code>
* representing the
* steps from here to the final step of the wizard, varying the returned
* object based on the contents of the map and the step in question.
* The default implementation of this method throws an <code>Error</code> -
* The default implementation of this method throws an <code>Error</code> -
* either override this method, or override <code>getWizardForStep()</code>
* (in which case this method will not be called).
* <p>
* <b>Note:</b> This method can be called very frequently, to determine
* if the sequence of steps has changed - so it needs to run fast.
* <b>Note:</b> This method can be called very frequently, to determine
* if the sequence of steps has changed - so it needs to run fast.
* Returning the same instance every time called with equivalent arguments
* is highly recommended.
*
* @param step The string ID of the current step
*
* @param step The string ID of the current step
* @param settings The settings map, which previous panes of the wizard
* will have written content into
* will have written content into
*/
protected WizardPanelProvider getPanelProviderForStep(String step, Map settings) {
throw new Error ("Override either createInfoForStep or " +
"createWizardForStep");
throw new Error("Override either createInfoForStep or "
+ "createWizardForStep");
}
SimpleWizardInfo getBase() {
return base;
}
private WizardImplementation wizard = null;
private Wizard real = null;
/**
* Create a Wizard to represent this branch controller. The resulting
* Create a Wizard to represent this branch controller. The resulting
* Wizard instance is cached; subsequent calls to this method will return
* the same instance.
*/
public final Wizard createWizard() {
if (wizard == null) {
wizard = new BranchingWizard (this);
real = new Wizard (wizard);
wizard = new BranchingWizard(this);
real = new Wizard(wizard);
}
return real;
}
@@ -167,6 +167,7 @@ ui.message.enter_password=请在左边输入您的密码
ui.message.launching=启动中
ui.message.making=生成中
ui.message.sure_remove=真的要删除配置%s吗?
ui.message.update_java=请更新您的Java
ui.label.settings=选项
ui.label.crashing=<html>Hello Minecraft!遇到了无法处理的错误,请复制下列内容并通过mcbbs、贴吧、Github或Minecraft Forum反馈bug。</html>
@@ -220,29 +221,34 @@ settings.test_game=测试游戏
modpack=整合包
modpack.choose=选择要导入的游戏整合包文件,如果您希望更新整合包,请输入要更新的版本名
modpack.install.task=导入整合包
modpack.install_error=安装失败,可能是整合包格式不正确或操作文件失败
modpack.install.will_install=将会安装整合包:
modpack.save=选择要导出到的游戏整合包位置
modpack.save.task=导出整合包
modpack.export_error=导出失败,可能是您的游戏文件夹格式不正确或操作文件失败
modpack.export_finished=整合包导出完成,参见
modpack.included_launcher=整合包已包含启动器,可直接发布
modpack.not_included_launcher=整合包未包含启动器,可使用本软件的导入整合包功能导入整合包
modpack.enter_name=给游戏起个你喜欢的名字
modpack.task.save=导出整合包
modpack.task.install=导入整合包
modpack.task.install.error=安装失败,可能是整合包格式不正确或操作文件失败
modpack.task.install.will=将会安装整合包:
modpack.wizard=导出整合包向导
modpack.wizard.step.1=基本设置
modpack.wizard.step.1.title=设置整合包的主要信息
modpack.wizard.step.initialization.include_launcher=包含启动器
modpack.wizard.step.initialization.exported_version=要导出的游戏版本
modpack.wizard.step.initialization.save=选择要导出到的游戏整合包位置
modpack.wizard.step.initialization.warning=<html>在制作整合包前,请您确认您选择的版本可以正常启动,<br/>并保证您的Minecraft是正式版而非快照版,<br/>而且不应当将不允许非官方途径传播的Mod、材质包等纳入整合包。<br/>整合包会保存您目前的下载源设置</html>
modpack.wizard.step.2=文件选择
modpack.wizard.step.2.title=选中你不想加到整合包中的文件(夹)
modpack.wizard.step.3=整合包描述
modpack.wizard.step.3.title=描述你要制作的整合包
modpack.desc=描述你要制作的整合包,比如整合包注意事项和更新记录,支持Markdown(图片请用网络图片)。
modpack.incorrect_format.no_json=整合包格式错误,pack.json丢失
modpack.incorrect_format.no_jar=整合包格式错误,pack.json丢失jar字段
modpack.cannot_read_version=读取游戏版本失败
modpack.not_a_valid_location=不是一个有效整合包位置
modpack.warning=<html>在制作整合包前,请您确认您选择的版本可以正常启动,<br/>并保证您的Minecraft是正式版而非快照版,<br/>而且不应当将不允许非官方途径传播的Mod、材质包等纳入整合包。<br/>整合包会保存您目前的下载源设置</html>
modpack.name=整合包名称
modpack.not_a_valid_name=不是一个有效的整合包名称
@@ -277,9 +283,10 @@ advancedsettings.launcher_visibility.hide=游戏启动后隐藏启动器
advancedsettings.launcher_visibility.keep=保持启动器可见
advancedsettings.game_dir.default=默认(.minecraft/)
advancedsettings.game_dir.independent=各版本独立(.minecraft/versions/<版本名>/,除assets,libraries)
advancedsettings.no_jvm_args=不添加JVM参数(使用Java9时必勾)
advancedsettings.no_jvm_args=不添加默认的JVM参数(使用Java9时必勾)
advancedsettings.java_args_default=启动器默认添加的参数(请不要重复添加):-XX:+UseConcMarkSweepGC -XX:+CMSIncrementalMode -XX:-UseAdaptiveSizePolicy -XX:MaxPermSize=???m -Xmx???m -Dfml.ignoreInvalidMinecraftCertificates=true -Dfml.ignorePatchDiscrepancies=true
advancedsettings.wrapper_launcher=启动前执行命令(不必填写,将在游戏启动前调用)
advancedsettings.wrapper_launcher=前置指令(不必填写,如optirun)
advancedsettings.precall_command=启动前执行命令(不必填写,将在游戏启动前调用)
advancedsettings.server_ip=直入服务器ip地址(不必填写,启动游戏后直接进入对应服务器)
advancedsettings.cancel_wrapper_launcher=取消包裹启动器(出现奇怪问题时可尝试使用,与调试模式冲突)
@@ -167,6 +167,7 @@ ui.message.enter_password=\u8bf7\u5728\u5de6\u8fb9\u8f93\u5165\u60a8\u7684\u5bc6
ui.message.launching=\u542f\u52a8\u4e2d
ui.message.making=\u751f\u6210\u4e2d
ui.message.sure_remove=\u771f\u7684\u8981\u5220\u9664\u914d\u7f6e%s\u5417\uff1f
ui.message.update_java=\u8bf7\u66f4\u65b0\u60a8\u7684Java
ui.label.settings=\u9009\u9879
ui.label.crashing=<html>Hello Minecraft!\u9047\u5230\u4e86\u65e0\u6cd5\u5904\u7406\u7684\u9519\u8bef\uff0c\u8bf7\u590d\u5236\u4e0b\u5217\u5185\u5bb9\u5e76\u901a\u8fc7mcbbs\u3001\u8d34\u5427\u3001Github\u6216Minecraft Forum\u53cd\u9988bug\u3002</html>
@@ -220,29 +221,34 @@ settings.test_game=\u6d4b\u8bd5\u6e38\u620f
modpack=\u6574\u5408\u5305
modpack.choose=\u9009\u62e9\u8981\u5bfc\u5165\u7684\u6e38\u620f\u6574\u5408\u5305\u6587\u4ef6\uff0c\u5982\u679c\u60a8\u5e0c\u671b\u66f4\u65b0\u6574\u5408\u5305\uff0c\u8bf7\u8f93\u5165\u8981\u66f4\u65b0\u7684\u7248\u672c\u540d
modpack.install.task=\u5bfc\u5165\u6574\u5408\u5305
modpack.install_error=\u5b89\u88c5\u5931\u8d25\uff0c\u53ef\u80fd\u662f\u6574\u5408\u5305\u683c\u5f0f\u4e0d\u6b63\u786e\u6216\u64cd\u4f5c\u6587\u4ef6\u5931\u8d25
modpack.install.will_install=\u5c06\u4f1a\u5b89\u88c5\u6574\u5408\u5305\uff1a
modpack.save=\u9009\u62e9\u8981\u5bfc\u51fa\u5230\u7684\u6e38\u620f\u6574\u5408\u5305\u4f4d\u7f6e
modpack.save.task=\u5bfc\u51fa\u6574\u5408\u5305
modpack.export_error=\u5bfc\u51fa\u5931\u8d25\uff0c\u53ef\u80fd\u662f\u60a8\u7684\u6e38\u620f\u6587\u4ef6\u5939\u683c\u5f0f\u4e0d\u6b63\u786e\u6216\u64cd\u4f5c\u6587\u4ef6\u5931\u8d25
modpack.export_finished=\u6574\u5408\u5305\u5bfc\u51fa\u5b8c\u6210\uff0c\u53c2\u89c1
modpack.included_launcher=\u6574\u5408\u5305\u5df2\u5305\u542b\u542f\u52a8\u5668\uff0c\u53ef\u76f4\u63a5\u53d1\u5e03
modpack.not_included_launcher=\u6574\u5408\u5305\u672a\u5305\u542b\u542f\u52a8\u5668\uff0c\u53ef\u4f7f\u7528\u672c\u8f6f\u4ef6\u7684\u5bfc\u5165\u6574\u5408\u5305\u529f\u80fd\u5bfc\u5165\u6574\u5408\u5305
modpack.enter_name=\u7ed9\u6e38\u620f\u8d77\u4e2a\u4f60\u559c\u6b22\u7684\u540d\u5b57
modpack.task.save=\u5bfc\u51fa\u6574\u5408\u5305
modpack.task.install=\u5bfc\u5165\u6574\u5408\u5305
modpack.task.install.error=\u5b89\u88c5\u5931\u8d25\uff0c\u53ef\u80fd\u662f\u6574\u5408\u5305\u683c\u5f0f\u4e0d\u6b63\u786e\u6216\u64cd\u4f5c\u6587\u4ef6\u5931\u8d25
modpack.task.install.will=\u5c06\u4f1a\u5b89\u88c5\u6574\u5408\u5305\uff1a
modpack.wizard=\u5bfc\u51fa\u6574\u5408\u5305\u5411\u5bfc
modpack.wizard.step.1=\u57fa\u672c\u8bbe\u7f6e
modpack.wizard.step.1.title=\u8bbe\u7f6e\u6574\u5408\u5305\u7684\u4e3b\u8981\u4fe1\u606f
modpack.wizard.step.initialization.include_launcher=\u5305\u542b\u542f\u52a8\u5668
modpack.wizard.step.initialization.exported_version=\u8981\u5bfc\u51fa\u7684\u6e38\u620f\u7248\u672c
modpack.wizard.step.initialization.save=\u9009\u62e9\u8981\u5bfc\u51fa\u5230\u7684\u6e38\u620f\u6574\u5408\u5305\u4f4d\u7f6e
modpack.wizard.step.initialization.warning=<html>\u5728\u5236\u4f5c\u6574\u5408\u5305\u524d\uff0c\u8bf7\u60a8\u786e\u8ba4\u60a8\u9009\u62e9\u7684\u7248\u672c\u53ef\u4ee5\u6b63\u5e38\u542f\u52a8\uff0c<br/>\u5e76\u4fdd\u8bc1\u60a8\u7684Minecraft\u662f\u6b63\u5f0f\u7248\u800c\u975e\u5feb\u7167\u7248\uff0c<br/>\u800c\u4e14\u4e0d\u5e94\u5f53\u5c06\u4e0d\u5141\u8bb8\u975e\u5b98\u65b9\u9014\u5f84\u4f20\u64ad\u7684Mod\u3001\u6750\u8d28\u5305\u7b49\u7eb3\u5165\u6574\u5408\u5305\u3002<br/>\u6574\u5408\u5305\u4f1a\u4fdd\u5b58\u60a8\u76ee\u524d\u7684\u4e0b\u8f7d\u6e90\u8bbe\u7f6e</html>
modpack.wizard.step.2=\u6587\u4ef6\u9009\u62e9
modpack.wizard.step.2.title=\u9009\u4e2d\u4f60\u4e0d\u60f3\u52a0\u5230\u6574\u5408\u5305\u4e2d\u7684\u6587\u4ef6(\u5939)
modpack.wizard.step.3=\u6574\u5408\u5305\u63cf\u8ff0
modpack.wizard.step.3.title=\u63cf\u8ff0\u4f60\u8981\u5236\u4f5c\u7684\u6574\u5408\u5305
modpack.desc=\u63cf\u8ff0\u4f60\u8981\u5236\u4f5c\u7684\u6574\u5408\u5305\uff0c\u6bd4\u5982\u6574\u5408\u5305\u6ce8\u610f\u4e8b\u9879\u548c\u66f4\u65b0\u8bb0\u5f55\uff0c\u652f\u6301Markdown(\u56fe\u7247\u8bf7\u7528\u7f51\u7edc\u56fe\u7247)\u3002
modpack.incorrect_format.no_json=\u6574\u5408\u5305\u683c\u5f0f\u9519\u8bef\uff0cpack.json\u4e22\u5931
modpack.incorrect_format.no_jar=\u6574\u5408\u5305\u683c\u5f0f\u9519\u8bef\uff0cpack.json\u4e22\u5931jar\u5b57\u6bb5
modpack.cannot_read_version=\u8bfb\u53d6\u6e38\u620f\u7248\u672c\u5931\u8d25
modpack.not_a_valid_location=\u4e0d\u662f\u4e00\u4e2a\u6709\u6548\u6574\u5408\u5305\u4f4d\u7f6e
modpack.warning=<html>\u5728\u5236\u4f5c\u6574\u5408\u5305\u524d\uff0c\u8bf7\u60a8\u786e\u8ba4\u60a8\u9009\u62e9\u7684\u7248\u672c\u53ef\u4ee5\u6b63\u5e38\u542f\u52a8\uff0c<br/>\u5e76\u4fdd\u8bc1\u60a8\u7684Minecraft\u662f\u6b63\u5f0f\u7248\u800c\u975e\u5feb\u7167\u7248\uff0c<br/>\u800c\u4e14\u4e0d\u5e94\u5f53\u5c06\u4e0d\u5141\u8bb8\u975e\u5b98\u65b9\u9014\u5f84\u4f20\u64ad\u7684Mod\u3001\u6750\u8d28\u5305\u7b49\u7eb3\u5165\u6574\u5408\u5305\u3002<br/>\u6574\u5408\u5305\u4f1a\u4fdd\u5b58\u60a8\u76ee\u524d\u7684\u4e0b\u8f7d\u6e90\u8bbe\u7f6e</html>
modpack.name=\u6574\u5408\u5305\u540d\u79f0
modpack.not_a_valid_name=\u4e0d\u662f\u4e00\u4e2a\u6709\u6548\u7684\u6574\u5408\u5305\u540d\u79f0
@@ -277,9 +283,10 @@ advancedsettings.launcher_visibility.hide=\u6e38\u620f\u542f\u52a8\u540e\u9690\u
advancedsettings.launcher_visibility.keep=\u4fdd\u6301\u542f\u52a8\u5668\u53ef\u89c1
advancedsettings.game_dir.default=\u9ed8\u8ba4(.minecraft/)
advancedsettings.game_dir.independent=\u5404\u7248\u672c\u72ec\u7acb(.minecraft/versions/<\u7248\u672c\u540d>/,\u9664assets,libraries)
advancedsettings.no_jvm_args=\u4e0d\u6dfb\u52a0JVM\u53c2\u6570(\u4f7f\u7528Java9\u65f6\u5fc5\u52fe)
advancedsettings.no_jvm_args=\u4e0d\u6dfb\u52a0\u9ed8\u8ba4\u7684JVM\u53c2\u6570(\u4f7f\u7528Java9\u65f6\u5fc5\u52fe)
advancedsettings.java_args_default=\u542f\u52a8\u5668\u9ed8\u8ba4\u6dfb\u52a0\u7684\u53c2\u6570\uff08\u8bf7\u4e0d\u8981\u91cd\u590d\u6dfb\u52a0\uff09\uff1a-XX:+UseConcMarkSweepGC -XX:+CMSIncrementalMode -XX:-UseAdaptiveSizePolicy -XX:MaxPermSize=???m -Xmx???m -Dfml.ignoreInvalidMinecraftCertificates=true -Dfml.ignorePatchDiscrepancies=true
advancedsettings.wrapper_launcher=\u542f\u52a8\u524d\u6267\u884c\u547d\u4ee4(\u4e0d\u5fc5\u586b\u5199\uff0c\u5c06\u5728\u6e38\u620f\u542f\u52a8\u524d\u8c03\u7528)
advancedsettings.wrapper_launcher=\u524d\u7f6e\u6307\u4ee4(\u4e0d\u5fc5\u586b\u5199,\u5982optirun)
advancedsettings.precall_command=\u542f\u52a8\u524d\u6267\u884c\u547d\u4ee4(\u4e0d\u5fc5\u586b\u5199\uff0c\u5c06\u5728\u6e38\u620f\u542f\u52a8\u524d\u8c03\u7528)
advancedsettings.server_ip=\u76f4\u5165\u670d\u52a1\u5668ip\u5730\u5740(\u4e0d\u5fc5\u586b\u5199\uff0c\u542f\u52a8\u6e38\u620f\u540e\u76f4\u63a5\u8fdb\u5165\u5bf9\u5e94\u670d\u52a1\u5668)
advancedsettings.cancel_wrapper_launcher=\u53d6\u6d88\u5305\u88f9\u542f\u52a8\u5668\uff08\u51fa\u73b0\u5947\u602a\u95ee\u9898\u65f6\u53ef\u5c1d\u8bd5\u4f7f\u7528,\u4e0e\u8c03\u8bd5\u6a21\u5f0f\u51b2\u7a81\uff09
@@ -167,6 +167,7 @@ ui.message.enter_password=Please enter your password.
ui.message.launching=Launching...
ui.message.making=Generating...
ui.message.sure_remove=Sure to remove profile %s?
ui.message.update_java=Please upgrade your Java.
ui.label.settings=Settings
ui.label.crashing=<html>Hello Minecraft! Launcher has crashed!</html>
@@ -220,29 +221,34 @@ settings.test_game=Test game
modpack=Mod pack
modpack.choose=Choose a modpack zip file which you want to import. If you want to update the modpack, please enter the version you want to update.
modpack.install.task=Import the modpack
modpack.install_error=Failed to install the modpack, maybe the modpack file is incorrect or failed to manage files.
modpack.install.will_install=Will install the modpack:
modpack.save=Choose a location which you want to export the game files to.
modpack.save.task=Export the modpack
modpack.export_error=Failed to export the modpack, maybe the format of your game directory is incorrect or failed to manage files.
modpack.export_finished=Exporting the modpack finished. See
modpack.included_launcher=The modpack has already included the launcher, you can publish it directly.
modpack.not_included_launcher=Use the modpack by "import modpack".
modpack.enter_name=Give this game a name which is your favorite.
modpack.task.save=Export the modpack
modpack.task.install=Import the modpack
modpack.task.install.error=Failed to install the modpack, maybe the modpack file is incorrect or failed to manage files.
modpack.task.install.will=Will install the modpack:
modpack.wizard=Exporting the modpack wizard
modpack.wizard.step.1=Basic options
modpack.wizard.step.1.title=Set the basic options to the modpack.
modpack.wizard.step.initialization.include_launcher=Include the launcher
modpack.wizard.step.initialization.exported_version=The exported game version
modpack.wizard.step.initialization.save=Choose a location which you want to export the game files to
modpack.wizard.step.initialization.warning=<html>Before making modpack, you should ensure that your game can launch successfully,<br/>and that your Minecraft is release, not snapshot.<br/>and that it is not allowed to add mods which is not allowed to distribute to the modpack.</html>
modpack.wizard.step.2=Files selection
modpack.wizard.step.2.title=Choose the files you do not want to put in the modpack.
modpack.wizard.step.3=Description
modpack.wizard.step.3.title=Describe your modpack.
modpack.desc=Describe your modpack, including precautions, changlog, supporting Markdown(also supporting online pictures).
modpack.incorrect_format.no_json=The format of the modpack is incorrect, pack.json is missing.
modpack.incorrect_format.no_jar=The format of the modpack is incorrect, pack.json does not have attribute 'jar'
modpack.cannot_read_version=Failed to gather the game version
modpack.not_a_valid_location=Not a valid modpack location
modpack.warning=<html>Before making modpack, you should ensure that your game can launch successfully,<br/>and that your Minecraft is release, not snapshot.<br/>and that it is not allowed to add mods which is not allowed to distribute to the modpack.</html>
modpack.name=Modpack Name
modpack.not_a_valid_name=Not a valid modpack name
@@ -277,9 +283,10 @@ advancedsettings.launcher_visibility.hide=Hide the launcher when the game launch
advancedsettings.launcher_visibility.keep=Keep the launcher visible.
advancedsettings.game_dir.default=Default (.minecraft/)
advancedsettings.game_dir.independent=Independent (.minecraft/versions/<version name>/, except assets,libraries)
advancedsettings.no_jvm_args=No JVM Args
advancedsettings.no_jvm_args=No Default JVM Args
advancedsettings.java_args_default=Default java args: -XX:+UseConcMarkSweepGC -XX:+CMSIncrementalMode -XX:-UseAdaptiveSizePolicy -XX:MaxPermSize=???m -Xmx???m -Dfml.ignoreInvalidMinecraftCertificates=true -Dfml.ignorePatchDiscrepancies=true
advancedsettings.wrapper_launcher=Wrapper Launcher(like optirun...)
advancedsettings.precall_command=Precalling command(will be executed before game launching)
advancedsettings.server_ip=Server Host
advancedsettings.cancel_wrapper_launcher=Cancel Wrapper Launcher
@@ -167,6 +167,7 @@ ui.message.enter_password=Please enter your password.
ui.message.launching=Launching...
ui.message.making=Generating...
ui.message.sure_remove=Sure to remove profile %s?
ui.message.update_java=Please upgrade your Java.
ui.label.settings=Settings
ui.label.crashing=<html>Hello Minecraft! Launcher has crashed!</html>
@@ -220,29 +221,34 @@ settings.test_game=Test game
modpack=Mod pack
modpack.choose=Choose a modpack zip file which you want to import. If you want to update the modpack, please enter the version you want to update.
modpack.install.task=Import the modpack
modpack.install_error=Failed to install the modpack, maybe the modpack file is incorrect or failed to manage files.
modpack.install.will_install=Will install the modpack:
modpack.save=Choose a location which you want to export the game files to.
modpack.save.task=Export the modpack
modpack.export_error=Failed to export the modpack, maybe the format of your game directory is incorrect or failed to manage files.
modpack.export_finished=Exporting the modpack finished. See
modpack.included_launcher=The modpack has already included the launcher, you can publish it directly.
modpack.not_included_launcher=Use the modpack by "import modpack".
modpack.enter_name=Give this game a name which is your favorite.
modpack.task.save=Export the modpack
modpack.task.install=Import the modpack
modpack.task.install.error=Failed to install the modpack, maybe the modpack file is incorrect or failed to manage files.
modpack.task.install.will=Will install the modpack:
modpack.wizard=Exporting the modpack wizard
modpack.wizard.step.1=Basic options
modpack.wizard.step.1.title=Set the basic options to the modpack.
modpack.wizard.step.initialization.include_launcher=Include the launcher
modpack.wizard.step.initialization.exported_version=The exported game version
modpack.wizard.step.initialization.save=Choose a location which you want to export the game files to
modpack.wizard.step.initialization.warning=<html>Before making modpack, you should ensure that your game can launch successfully,<br/>and that your Minecraft is release, not snapshot.<br/>and that it is not allowed to add mods which is not allowed to distribute to the modpack.</html>
modpack.wizard.step.2=Files selection
modpack.wizard.step.2.title=Choose the files you do not want to put in the modpack.
modpack.wizard.step.3=Description
modpack.wizard.step.3.title=Describe your modpack.
modpack.desc=Describe your modpack, including precautions, changlog, supporting Markdown(also supporting online pictures).
modpack.incorrect_format.no_json=The format of the modpack is incorrect, pack.json is missing.
modpack.incorrect_format.no_jar=The format of the modpack is incorrect, pack.json does not have attribute 'jar'
modpack.cannot_read_version=Failed to gather the game version
modpack.not_a_valid_location=Not a valid modpack location
modpack.warning=<html>Before making modpack, you should ensure that your game can launch successfully,<br/>and that your Minecraft is release, not snapshot.<br/>and that it is not allowed to add mods which is not allowed to distribute to the modpack.</html>
modpack.name=Modpack Name
modpack.not_a_valid_name=Not a valid modpack name
@@ -277,9 +283,10 @@ advancedsettings.launcher_visibility.hide=Hide the launcher when the game launch
advancedsettings.launcher_visibility.keep=Keep the launcher visible.
advancedsettings.game_dir.default=Default (.minecraft/)
advancedsettings.game_dir.independent=Independent (.minecraft/versions/<version name>/, except assets,libraries)
advancedsettings.no_jvm_args=No JVM Args
advancedsettings.no_jvm_args=No Default JVM Args
advancedsettings.java_args_default=Default java args: -XX:+UseConcMarkSweepGC -XX:+CMSIncrementalMode -XX:-UseAdaptiveSizePolicy -XX:MaxPermSize=???m -Xmx???m -Dfml.ignoreInvalidMinecraftCertificates=true -Dfml.ignorePatchDiscrepancies=true
advancedsettings.wrapper_launcher=Wrapper Launcher(like optirun...)
advancedsettings.precall_command=Precalling command(will be executed before game launching)
advancedsettings.server_ip=Server Host
advancedsettings.cancel_wrapper_launcher=Cancel Wrapper Launcher
@@ -167,6 +167,7 @@ ui.message.enter_password=請在左邊輸入您的密碼
ui.message.launching=啟動中
ui.message.making=生成中
ui.message.sure_remove=真的要删除配置%s吗?
ui.message.update_java=请更新您的Java
ui.label.settings=選項
ui.label.crashing=<html>Hello Minecraft! Launcher遇到了無法處理的錯誤,請複制下列內容並通過mcbbs、貼吧或Minecraft Forum反饋bug。 </html>
@@ -220,29 +221,34 @@ settings.test_game=測試遊戲
modpack=懶人包
modpack.choose=選擇要導入的遊戲懶人包資料,如果您希望更新懶人包,请输入要更新的版本名
modpack.install.task=導入懶人包
modpack.install_error=安裝失敗,可能是懶人包格式不正確或操作資料失敗
modpack.install.will_install=將會安裝懶人包:
modpack.save=選擇要導出到的遊戲懶人包位置
modpack.save.task=導出懶人包
modpack.export_error=導出失敗,可能是您的遊戲資料夾格式不正確或操作資料失敗
modpack.export_finished=懶人包導出完成,参见
modpack.included_launcher=懶人包已包含啟動器,可直接發布
modpack.not_included_launcher=懶人包未包含啟動器,可使用本軟件的導入懶人包功能導入懶人包
modpack.enter_name=給遊戲起個你喜歡的名字
modpack.task.save=導出懶人包
modpack.task.install=導入懶人包
modpack.task.install.error=安裝失敗,可能是懶人包格式不正確或操作資料失敗
modpack.task.install.will_install=將會安裝懶人包:
modpack.wizard=導出懶人包嚮導
modpack.wizard.step.1=基本設定
modpack.wizard.step.1.title=設置懶人包的主要信息
modpack.wizard.step.initialization.include_launcher=包含啟動器
modpack.wizard.step.initialization.exported_version=要導出的遊戲版本
modpack.wizard.step.initialization.save=選擇要導出到的遊戲懶人包位置
modpack.wizard.step.initialization.warning=<html>在製作懶人包前,請您確認您選擇的版本可以正常啟動,<br/>並保證您的Minecraft是正式版而非快照版,<br/>而且不應當將不允許非官方途徑傳播的Mod、材質包等納入整合包。<br/>懶人包會保存您目前的下載源設定</html>
modpack.wizard.step.2=資料選擇
modpack.wizard.step.2.title=選中你不想加到懶人包中的資料(夾)
modpack.wizard.step.3=懶人包描述
modpack.wizard.step.3.title=描述你要製作的懶人包。
modpack.desc=描述你要製作的懶人包,比如懶人包注意事項和更新記錄,支持Markdown(圖片請用網路圖片)。
modpack.incorrect_format.no_json=懶人包格式錯誤,pack.json丟失
modpack.incorrect_format.no_jar=懶人包格式錯誤,pack.json丟失jar字段
modpack.cannot_read_version=讀取遊戲版本失敗
modpack.not_a_valid_location=不是一个有效懒人包位置
modpack.warning=<html>在製作懶人包前,請您確認您選擇的版本可以正常啟動,<br/>並保證您的Minecraft是正式版而非快照版,<br/>而且不應當將不允許非官方途徑傳播的Mod、材質包等納入整合包。<br/>懶人包會保存您目前的下載源設定</html>
modpack.name=懶人包名稱
modpack.not_a_valid_name=不是一个有效的懶人包名稱
@@ -277,9 +283,10 @@ advancedsettings.launcher_visibility.hide=遊戲啟動後隱藏啟動器
advancedsettings.launcher_visibility.keep=保持啟動器可見
advancedsettings.game_dir.default=默認(.minecraft/)
advancedsettings.game_dir.independent=各版本獨立(.minecraft/versions/<版本名>/,除assets,libraries)
advancedsettings.no_jvm_args=不添加JVM參數(使用Java9時必勾)
advancedsettings.no_jvm_args=不添加默認的JVM參數(使用Java9時必勾)
advancedsettings.java_args_default=啟動器默認添加的參數(請不要重複添加):-XX:+UseConcMarkSweepGC -XX:+CMSIncrementalMode -XX:-UseAdaptiveSizePolicy -XX:MaxPermSize=???m -Xmx???m -Dfml. ignoreInvalidMinecraftCertificates=true -Dfml.ignorePatchDiscrepancies=true
advancedsettings.wrapper_launcher=前置啟動指令(不必填寫,內容將加在啟動腳本最前,如optirun...)
advancedsettings.wrapper_launcher=前置指令(不必填寫,如optirun)
advancedsettings.precall_command=啟動前執行命令(不必填寫,將在遊戲啟動前調用)
advancedsettings.server_ip=直入伺服器ip地址(不必填寫,啟動遊戲後直接進入對應伺服器)
advancedsettings.cancel_wrapper_launcher=取消包裹啟動器(出現奇怪問題時可嘗試使用,與調試模式衝突)
@@ -167,6 +167,7 @@ ui.message.enter_password=\u8acb\u5728\u5de6\u908a\u8f38\u5165\u60a8\u7684\u5bc6
ui.message.launching=\u555f\u52d5\u4e2d
ui.message.making=\u751f\u6210\u4e2d
ui.message.sure_remove=\u771f\u7684\u8981\u5220\u9664\u914d\u7f6e%s\u5417\uff1f
ui.message.update_java=\u8bf7\u66f4\u65b0\u60a8\u7684Java
ui.label.settings=\u9078\u9805
ui.label.crashing=<html>Hello Minecraft! Launcher\u9047\u5230\u4e86\u7121\u6cd5\u8655\u7406\u7684\u932f\u8aa4\uff0c\u8acb\u8907\u5236\u4e0b\u5217\u5167\u5bb9\u4e26\u901a\u904emcbbs\u3001\u8cbc\u5427\u6216Minecraft Forum\u53cd\u994bbug\u3002 </html>
@@ -220,29 +221,34 @@ settings.test_game=\u6e2c\u8a66\u904a\u6232
modpack=\u61f6\u4eba\u5305
modpack.choose=\u9078\u64c7\u8981\u5c0e\u5165\u7684\u904a\u6232\u61f6\u4eba\u5305\u8cc7\u6599\uff0c\u5982\u679c\u60a8\u5e0c\u671b\u66f4\u65b0\u61f6\u4eba\u5305\uff0c\u8bf7\u8f93\u5165\u8981\u66f4\u65b0\u7684\u7248\u672c\u540d
modpack.install.task=\u5c0e\u5165\u61f6\u4eba\u5305
modpack.install_error=\u5b89\u88dd\u5931\u6557\uff0c\u53ef\u80fd\u662f\u61f6\u4eba\u5305\u683c\u5f0f\u4e0d\u6b63\u78ba\u6216\u64cd\u4f5c\u8cc7\u6599\u5931\u6557
modpack.install.will_install=\u5c07\u6703\u5b89\u88dd\u61f6\u4eba\u5305\uff1a
modpack.save=\u9078\u64c7\u8981\u5c0e\u51fa\u5230\u7684\u904a\u6232\u61f6\u4eba\u5305\u4f4d\u7f6e
modpack.save.task=\u5c0e\u51fa\u61f6\u4eba\u5305
modpack.export_error=\u5c0e\u51fa\u5931\u6557\uff0c\u53ef\u80fd\u662f\u60a8\u7684\u904a\u6232\u8cc7\u6599\u593e\u683c\u5f0f\u4e0d\u6b63\u78ba\u6216\u64cd\u4f5c\u8cc7\u6599\u5931\u6557
modpack.export_finished=\u61f6\u4eba\u5305\u5c0e\u51fa\u5b8c\u6210\uff0c\u53c2\u89c1
modpack.included_launcher=\u61f6\u4eba\u5305\u5df2\u5305\u542b\u555f\u52d5\u5668\uff0c\u53ef\u76f4\u63a5\u767c\u5e03
modpack.not_included_launcher=\u61f6\u4eba\u5305\u672a\u5305\u542b\u555f\u52d5\u5668\uff0c\u53ef\u4f7f\u7528\u672c\u8edf\u4ef6\u7684\u5c0e\u5165\u61f6\u4eba\u5305\u529f\u80fd\u5c0e\u5165\u61f6\u4eba\u5305
modpack.enter_name=\u7d66\u904a\u6232\u8d77\u500b\u4f60\u559c\u6b61\u7684\u540d\u5b57
modpack.task.save=\u5c0e\u51fa\u61f6\u4eba\u5305
modpack.task.install=\u5c0e\u5165\u61f6\u4eba\u5305
modpack.task.install.error=\u5b89\u88dd\u5931\u6557\uff0c\u53ef\u80fd\u662f\u61f6\u4eba\u5305\u683c\u5f0f\u4e0d\u6b63\u78ba\u6216\u64cd\u4f5c\u8cc7\u6599\u5931\u6557
modpack.task.install.will_install=\u5c07\u6703\u5b89\u88dd\u61f6\u4eba\u5305\uff1a
modpack.wizard=\u5c0e\u51fa\u61f6\u4eba\u5305\u56ae\u5c0e
modpack.wizard.step.1=\u57fa\u672c\u8a2d\u5b9a
modpack.wizard.step.1.title=\u8a2d\u7f6e\u61f6\u4eba\u5305\u7684\u4e3b\u8981\u4fe1\u606f
modpack.wizard.step.initialization.include_launcher=\u5305\u542b\u555f\u52d5\u5668
modpack.wizard.step.initialization.exported_version=\u8981\u5c0e\u51fa\u7684\u904a\u6232\u7248\u672c
modpack.wizard.step.initialization.save=\u9078\u64c7\u8981\u5c0e\u51fa\u5230\u7684\u904a\u6232\u61f6\u4eba\u5305\u4f4d\u7f6e
modpack.wizard.step.initialization.warning=<html>\u5728\u88fd\u4f5c\u61f6\u4eba\u5305\u524d,\u8acb\u60a8\u78ba\u8a8d\u60a8\u9078\u64c7\u7684\u7248\u672c\u53ef\u4ee5\u6b63\u5e38\u555f\u52d5,<br/>\u4e26\u4fdd\u8b49\u60a8\u7684Minecraft\u662f\u6b63\u5f0f\u7248\u800c\u975e\u5feb\u7167\u7248,<br/>\u800c\u4e14\u4e0d\u61c9\u7576\u5c07\u4e0d\u5141\u8a31\u975e\u5b98\u65b9\u9014\u5f91\u50b3\u64ad\u7684Mod\u3001\u6750\u8cea\u5305\u7b49\u7d0d\u5165\u6574\u5408\u5305\u3002<br/>\u61f6\u4eba\u5305\u6703\u4fdd\u5b58\u60a8\u76ee\u524d\u7684\u4e0b\u8f09\u6e90\u8a2d\u5b9a</html>
modpack.wizard.step.2=\u8cc7\u6599\u9078\u64c7
modpack.wizard.step.2.title=\u9078\u4e2d\u4f60\u4e0d\u60f3\u52a0\u5230\u61f6\u4eba\u5305\u4e2d\u7684\u8cc7\u6599(\u593e)
modpack.wizard.step.3=\u61f6\u4eba\u5305\u63cf\u8ff0
modpack.wizard.step.3.title=\u63cf\u8ff0\u4f60\u8981\u88fd\u4f5c\u7684\u61f6\u4eba\u5305\u3002
modpack.desc=\u63cf\u8ff0\u4f60\u8981\u88fd\u4f5c\u7684\u61f6\u4eba\u5305\uff0c\u6bd4\u5982\u61f6\u4eba\u5305\u6ce8\u610f\u4e8b\u9805\u548c\u66f4\u65b0\u8a18\u9304\uff0c\u652f\u6301Markdown(\u5716\u7247\u8acb\u7528\u7db2\u8def\u5716\u7247)\u3002
modpack.incorrect_format.no_json=\u61f6\u4eba\u5305\u683c\u5f0f\u932f\u8aa4\uff0cpack.json\u4e1f\u5931
modpack.incorrect_format.no_jar=\u61f6\u4eba\u5305\u683c\u5f0f\u932f\u8aa4\uff0cpack.json\u4e1f\u5931jar\u5b57\u6bb5
modpack.cannot_read_version=\u8b80\u53d6\u904a\u6232\u7248\u672c\u5931\u6557
modpack.not_a_valid_location=\u4e0d\u662f\u4e00\u4e2a\u6709\u6548\u61d2\u4eba\u5305\u4f4d\u7f6e
modpack.warning=<html>\u5728\u88fd\u4f5c\u61f6\u4eba\u5305\u524d,\u8acb\u60a8\u78ba\u8a8d\u60a8\u9078\u64c7\u7684\u7248\u672c\u53ef\u4ee5\u6b63\u5e38\u555f\u52d5,<br/>\u4e26\u4fdd\u8b49\u60a8\u7684Minecraft\u662f\u6b63\u5f0f\u7248\u800c\u975e\u5feb\u7167\u7248,<br/>\u800c\u4e14\u4e0d\u61c9\u7576\u5c07\u4e0d\u5141\u8a31\u975e\u5b98\u65b9\u9014\u5f91\u50b3\u64ad\u7684Mod\u3001\u6750\u8cea\u5305\u7b49\u7d0d\u5165\u6574\u5408\u5305\u3002<br/>\u61f6\u4eba\u5305\u6703\u4fdd\u5b58\u60a8\u76ee\u524d\u7684\u4e0b\u8f09\u6e90\u8a2d\u5b9a</html>
modpack.name=\u61f6\u4eba\u5305\u540d\u7a31
modpack.not_a_valid_name=\u4e0d\u662f\u4e00\u4e2a\u6709\u6548\u7684\u61f6\u4eba\u5305\u540d\u7a31
@@ -277,9 +283,10 @@ advancedsettings.launcher_visibility.hide=\u904a\u6232\u555f\u52d5\u5f8c\u96b1\u
advancedsettings.launcher_visibility.keep=\u4fdd\u6301\u555f\u52d5\u5668\u53ef\u898b
advancedsettings.game_dir.default=\u9ed8\u8a8d(.minecraft/)
advancedsettings.game_dir.independent=\u5404\u7248\u672c\u7368\u7acb(.minecraft/versions/<\u7248\u672c\u540d>/,\u9664assets,libraries)
advancedsettings.no_jvm_args=\u4e0d\u6dfb\u52a0JVM\u53c3\u6578(\u4f7f\u7528Java9\u6642\u5fc5\u52fe)
advancedsettings.no_jvm_args=\u4e0d\u6dfb\u52a0\u9ed8\u8a8d\u7684JVM\u53c3\u6578(\u4f7f\u7528Java9\u6642\u5fc5\u52fe)
advancedsettings.java_args_default=\u555f\u52d5\u5668\u9ed8\u8a8d\u6dfb\u52a0\u7684\u53c3\u6578\uff08\u8acb\u4e0d\u8981\u91cd\u8907\u6dfb\u52a0\uff09\uff1a-XX:+UseConcMarkSweepGC -XX:+CMSIncrementalMode -XX:-UseAdaptiveSizePolicy -XX:MaxPermSize=???m -Xmx???m -Dfml. ignoreInvalidMinecraftCertificates=true -Dfml.ignorePatchDiscrepancies=true
advancedsettings.wrapper_launcher=\u524d\u7f6e\u555f\u52d5\u6307\u4ee4(\u4e0d\u5fc5\u586b\u5beb\uff0c\u5167\u5bb9\u5c07\u52a0\u5728\u555f\u52d5\u8173\u672c\u6700\u524d\uff0c\u5982optirun...)
advancedsettings.wrapper_launcher=\u524d\u7f6e\u6307\u4ee4(\u4e0d\u5fc5\u586b\u5beb,\u5982optirun)
advancedsettings.precall_command=\u555f\u52d5\u524d\u57f7\u884c\u547d\u4ee4(\u4e0d\u5fc5\u586b\u5beb,\u5c07\u5728\u904a\u6232\u555f\u52d5\u524d\u8abf\u7528)
advancedsettings.server_ip=\u76f4\u5165\u4f3a\u670d\u5668ip\u5730\u5740(\u4e0d\u5fc5\u586b\u5beb\uff0c\u555f\u52d5\u904a\u6232\u5f8c\u76f4\u63a5\u9032\u5165\u5c0d\u61c9\u4f3a\u670d\u5668)
advancedsettings.cancel_wrapper_launcher=\u53d6\u6d88\u5305\u88f9\u555f\u52d5\u5668(\u51fa\u73fe\u5947\u602a\u554f\u984c\u6642\u53ef\u5617\u8a66\u4f7f\u7528,\u8207\u8abf\u8a66\u6a21\u5f0f\u885d\u7a81)
+10 -2
View File
@@ -22,10 +22,18 @@ if (!hasProperty('mainClass')) {
ext.mainClass = 'org.jackhuang.hellominecraft.svrmgr.Main'
}
def buildnumber = System.getenv("BUILD_NUMBER") == null ? "" : "."+System.getenv("BUILD_NUMBER")
def buildnumber = System.getenv("TRAVIS_BUILD_NUMBER")
if (buildnumber == null)
buildnumber = System.getenv("BUILD_NUMBER")
if (buildnumber == null)
buildnumber = "233"
def versionroot = System.getenv("VERSION_ROOT")
if (versionroot == null)
versionroot = "0.8.7"
String mavenGroupId = 'HMCSM'
String mavenVersion = '0.8.6' + buildnumber
String mavenVersion = versionroot + '.' + buildnumber
String bundleName = "Hello Minecraft! Server Manager"
group = mavenGroupId
@@ -40,7 +40,7 @@ public class Main {
public static String launcherName = "Hello Minecraft! Server Manager";
public static final String PUBLISH_URL = "http://www.mcbbs.net/thread-171239-1-1.html";
public static final byte VERSION_FIRST = 0, VERSION_SECOND = 8, VERSION_THIRD = 6;
public static final byte VERSION_FIRST = 0, VERSION_SECOND = 8, VERSION_THIRD = 7;
public static final UpdateChecker UPDATE_CHECKER = new UpdateChecker(new VersionNumber(VERSION_FIRST, VERSION_SECOND, VERSION_THIRD), "hmcsm");
public static String makeTitle() {
@@ -209,14 +209,23 @@ public final class MainWindow extends javax.swing.JFrame
//<editor-fold defaultstate="collapsed" desc="基本信息菜单">
class ActionListenerImpl implements ActionListener {
String s;
String s, q;
public ActionListenerImpl(String s) {
this(s, null);
}
public ActionListenerImpl(String s, String question) {
this.s = s;
q = question;
}
@Override
public void actionPerformed(ActionEvent e) {
String ans = q == null ? "" : JOptionPane.showInputDialog(q);
if (ans == null)
return;
s = s.replace("{}", ans);
Server.getInstance().sendCommand(s);
}
@@ -233,9 +242,9 @@ public final class MainWindow extends javax.swing.JFrame
itm.addActionListener(new ActionListenerImpl("time set 0"));
ppmBasically.add(itm);
itm = new JMenuItem("广播");
itm.addActionListener(new ActionListenerImpl("say " + JOptionPane.showInputDialog("广播讯息")));
itm.addActionListener(new ActionListenerImpl("say {}", JOptionPane.showInputDialog("广播讯息")));
itm = new JMenuItem("红字广播");
itm.addActionListener(new ActionListenerImpl("me " + JOptionPane.showInputDialog("广播讯息")));
itm.addActionListener(new ActionListenerImpl("me {}", JOptionPane.showInputDialog("广播讯息")));
itm = new JMenuItem("私聊");
itm.addActionListener(e -> {
InputDialog id = new InputDialog(MainWindow.this, true, new String[] { "玩家", "讯息" });
@@ -244,16 +253,16 @@ public final class MainWindow extends javax.swing.JFrame
});
ppmBasically.add(itm);
itm = new JMenuItem("给予OP");
itm.addActionListener(new ActionListenerImpl("op " + JOptionPane.showInputDialog("新OP的游戏名")));
itm.addActionListener(new ActionListenerImpl("op {}", JOptionPane.showInputDialog("新OP的游戏名")));
ppmBasically.add(itm);
itm = new JMenuItem("卸除OP");
itm.addActionListener(new ActionListenerImpl("deop " + JOptionPane.showInputDialog("要卸除OP的游戏名")));
itm.addActionListener(new ActionListenerImpl("deop {}", JOptionPane.showInputDialog("要卸除OP的游戏名")));
ppmBasically.add(itm);
itm = new JMenuItem("给予玩家白名单");
itm.addActionListener(new ActionListenerImpl("whitelist add " + JOptionPane.showInputDialog("要添入白名单的游戏名")));
itm.addActionListener(new ActionListenerImpl("whitelist add {}", JOptionPane.showInputDialog("要添入白名单的游戏名")));
ppmBasically.add(itm);
itm = new JMenuItem("解除玩家白名单");
itm.addActionListener(new ActionListenerImpl("whitelist remove " + JOptionPane.showInputDialog("要解除白名单的游戏名")));
itm.addActionListener(new ActionListenerImpl("whitelist remove {}", JOptionPane.showInputDialog("要解除白名单的游戏名")));
ppmBasically.add(itm);
itm = new JMenuItem("启用白名单");
itm.addActionListener(new ActionListenerImpl("whitelist on"));
@@ -265,31 +274,31 @@ public final class MainWindow extends javax.swing.JFrame
itm.addActionListener(new ActionListenerImpl("whitelist list"));
ppmBasically.add(itm);
itm = new JMenuItem("封禁玩家");
itm.addActionListener(new ActionListenerImpl("ban " + JOptionPane.showInputDialog("要封禁玩家的游戏名")));
itm.addActionListener(new ActionListenerImpl("ban {}", JOptionPane.showInputDialog("要封禁玩家的游戏名")));
ppmBasically.add(itm);
itm = new JMenuItem("封禁玩家IP");
itm.addActionListener(new ActionListenerImpl("ban-ip " + JOptionPane.showInputDialog("要封禁玩家IP的游戏名")));
itm.addActionListener(new ActionListenerImpl("ban-ip {}", JOptionPane.showInputDialog("要封禁玩家IP的游戏名")));
itm = new JMenuItem("解封玩家");
itm.addActionListener(new ActionListenerImpl("pardon " + JOptionPane.showInputDialog("要解封玩家的游戏名")));
itm.addActionListener(new ActionListenerImpl("pardon {}", JOptionPane.showInputDialog("要解封玩家的游戏名")));
ppmBasically.add(itm);
itm = new JMenuItem("解封玩家IP");
itm.addActionListener(new ActionListenerImpl("pardon-ip " + JOptionPane.showInputDialog("要解封玩家IP的游戏名")));
itm.addActionListener(new ActionListenerImpl("pardon-ip {}", JOptionPane.showInputDialog("要解封玩家IP的游戏名")));
itm = new JMenuItem("封禁玩家");
itm.addActionListener(new ActionListenerImpl("ban " + JOptionPane.showInputDialog("要封禁玩家的游戏名")));
itm.addActionListener(new ActionListenerImpl("ban {}", JOptionPane.showInputDialog("要封禁玩家的游戏名")));
ppmBasically.add(itm);
itm = new JMenuItem("封禁玩家IP");
itm.addActionListener(new ActionListenerImpl("ban-ip " + JOptionPane.showInputDialog("要封禁玩家IP的游戏名")));
itm.addActionListener(new ActionListenerImpl("ban-ip {}", JOptionPane.showInputDialog("要封禁玩家IP的游戏名")));
itm = new JMenuItem("封禁玩家列表");
itm.addActionListener(new ActionListenerImpl("banlist"));
ppmBasically.add(itm);
itm = new JMenuItem("修改时间");
itm.addActionListener(new ActionListenerImpl("time set " + JOptionPane.showInputDialog("要调整的时间值")));
itm.addActionListener(new ActionListenerImpl("time set {}", JOptionPane.showInputDialog("要调整的时间值")));
ppmBasically.add(itm);
itm = new JMenuItem("往后调整时间");
itm.addActionListener(new ActionListenerImpl("time add " + JOptionPane.showInputDialog("要往后调整的时间值")));
itm.addActionListener(new ActionListenerImpl("time add {}", JOptionPane.showInputDialog("要往后调整的时间值")));
ppmBasically.add(itm);
itm = new JMenuItem("调整天气");
itm.addActionListener(new ActionListenerImpl("weather " + JOptionPane.showInputDialog("要调整的天气(只能填:clear[意思是取消所有天气]或rain[意思是下雨]或thunder[意思是打雷]")));
itm.addActionListener(new ActionListenerImpl("weather {}", JOptionPane.showInputDialog("要调整的天气(只能填:clear[意思是取消所有天气]或rain[意思是下雨]或thunder[意思是打雷]")));
ppmBasically.add(itm);
itm = new JMenuItem("调整一定时间的天气");
itm.addActionListener(e -> {
@@ -305,10 +314,10 @@ public final class MainWindow extends javax.swing.JFrame
});
ppmBasically.add(itm);
itm = new JMenuItem("清除背包");
itm.addActionListener(new ActionListenerImpl("clear" + JOptionPane.showInputDialog("要被清除背包的玩家")));
itm.addActionListener(new ActionListenerImpl("clear {}", JOptionPane.showInputDialog("要被清除背包的玩家")));
ppmBasically.add(itm);
itm = new JMenuItem("踢出玩家");
itm.addActionListener(new ActionListenerImpl("kick " + JOptionPane.showInputDialog("要被踢出的玩家")));
itm.addActionListener(new ActionListenerImpl("kick {}", JOptionPane.showInputDialog("要被踢出的玩家")));
ppmBasically.add(itm);
itm = new JMenuItem("在线玩家");
itm.addActionListener(new ActionListenerImpl("list"));
@@ -334,10 +343,10 @@ public final class MainWindow extends javax.swing.JFrame
itm.addActionListener(new ActionListenerImpl("save-off"));
ppmBasically.add(itm);
itm = new JMenuItem("难度");
itm.addActionListener(new ActionListenerImpl("difficulty " + JOptionPane.showInputDialog("难度")));
itm.addActionListener(new ActionListenerImpl("difficulty {}", JOptionPane.showInputDialog("难度")));
ppmBasically.add(itm);
itm = new JMenuItem("默认游戏模式");
itm.addActionListener(new ActionListenerImpl("defaultgamemode " + JOptionPane.showInputDialog("默认游戏模式")));
itm.addActionListener(new ActionListenerImpl("defaultgamemode {}", JOptionPane.showInputDialog("默认游戏模式")));
ppmBasically.add(itm);
itm = new JMenuItem("地图种子");
itm.addActionListener(new ActionListenerImpl("seed"));