Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b36c194f67 | ||
|
|
7c7b6e0fd9 | ||
|
|
01b77f1f5f | ||
|
|
840a0ad840 | ||
|
|
ab1ca18488 | ||
|
|
75e0fa2def | ||
|
|
ca3ed47d21 | ||
|
|
61a8ab5199 | ||
|
|
ce721c2e09 | ||
|
|
2862e3a6ee | ||
|
|
75c4a24cbd | ||
|
|
1cf7d791cc | ||
|
|
62fecc08ac |
No files matched your search
Executable → Regular
+2
@@ -25,3 +25,5 @@ HMCL/build/
|
||||
HMCLServer/
|
||||
HMCSM/build/
|
||||
MetroLookAndFeel/build/
|
||||
/HMCUtils/build/
|
||||
/HMCLaF/build/
|
||||
@@ -14,6 +14,15 @@
|
||||
<task-args/>
|
||||
<task-jvm-args/>
|
||||
</task>
|
||||
<task>
|
||||
<display-name>createApp</display-name>
|
||||
<non-blocking>no</non-blocking>
|
||||
<task-names>
|
||||
<name must-exist="yes">createApp</name>
|
||||
</task-names>
|
||||
<task-args/>
|
||||
<task-jvm-args/>
|
||||
</task>
|
||||
</common-tasks>
|
||||
<script-platform>
|
||||
<spec-name>j2se</spec-name>
|
||||
|
||||
@@ -16,8 +16,10 @@ deploy:
|
||||
file:
|
||||
- HMCL/build/libs/HMCL-${HMCL_VERSION_ROOT}.${TRAVIS_BUILD_NUMBER}.jar
|
||||
- HMCL/build/libs/HMCL-${HMCL_VERSION_ROOT}.${TRAVIS_BUILD_NUMBER}.exe
|
||||
- HMCL/build/libs/HMCL-${HMCL_VERSION_ROOT}.${TRAVIS_BUILD_NUMBER}-MacOSApp.zip
|
||||
- HMCSM/build/libs/HMCSM-${HMCSM_VERSION_ROOT}.${TRAVIS_BUILD_NUMBER}.jar
|
||||
- HMCSM/build/libs/HMCSM-${HMCSM_VERSION_ROOT}.${TRAVIS_BUILD_NUMBER}.exe
|
||||
- HMCSM/build/libs/HMCSM-${HMCSM_VERSION_ROOT}.${TRAVIS_BUILD_NUMBER}-MacOSApp.zip
|
||||
on:
|
||||
repo: huanghongxun/HMCL
|
||||
tags: false
|
||||
|
||||
+61
-13
@@ -15,6 +15,26 @@
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see {http://www.gnu.org/licenses/}.
|
||||
*/
|
||||
buildscript {
|
||||
repositories {
|
||||
mavenCentral();
|
||||
|
||||
maven {
|
||||
url "https://libraries.minecraft.net"
|
||||
}
|
||||
|
||||
dependencies {
|
||||
classpath 'net.sf.proguard:proguard-gradle:4.10'
|
||||
classpath 'edu.sc.seis.gradle:launch4j:1.0.6'
|
||||
classpath 'me.tatarka:gradle-retrolambda:3.1.0'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
plugins {
|
||||
id "edu.sc.seis.macAppBundle" version "2.1.6"
|
||||
}
|
||||
|
||||
import java.util.jar.JarOutputStream
|
||||
import java.util.zip.ZipEntry
|
||||
import java.util.zip.ZipFile
|
||||
@@ -47,6 +67,7 @@ String mavenArtifactId = name
|
||||
|
||||
task generateSources(type: Copy) {
|
||||
from 'src/main/java'
|
||||
from 'src/core/java'
|
||||
into "$buildDir/generated-src"
|
||||
filter(org.apache.tools.ant.filters.ReplaceTokens, tokens: [
|
||||
'HELLO_MINECRAFT_LAUNCHER_VERSION_FOR_GRADLE_REPLACING': mavenVersion
|
||||
@@ -55,20 +76,46 @@ task generateSources(type: Copy) {
|
||||
compileJava.setSource "$buildDir/generated-src"
|
||||
compileJava.dependsOn generateSources
|
||||
|
||||
buildscript {
|
||||
repositories {
|
||||
mavenCentral();
|
||||
|
||||
maven {
|
||||
url "https://libraries.minecraft.net"
|
||||
task macAppCompressed(type: Zip, dependsOn: createApp) {
|
||||
archiveName "HMCL-$mavenVersion-MacOSApp.zip"
|
||||
include '**'
|
||||
destinationDir file("$buildDir/libs/")
|
||||
from "$buildDir/macApp"
|
||||
}
|
||||
|
||||
macAppBundle {
|
||||
mainClassName = mainClass
|
||||
icon = "src/main/icon.icns"
|
||||
javaProperties.put("apple.laf.useScreenMenuBar", "true")
|
||||
}
|
||||
|
||||
sourceSets {
|
||||
main {
|
||||
java {
|
||||
srcDirs = [
|
||||
'src/core/java/',
|
||||
'src/main/java/'
|
||||
]
|
||||
}
|
||||
|
||||
dependencies {
|
||||
classpath 'net.sf.proguard:proguard-gradle:4.10'
|
||||
classpath 'edu.sc.seis.gradle:launch4j:1.0.6'
|
||||
classpath 'me.tatarka:gradle-retrolambda:3.1.0'
|
||||
resources {
|
||||
srcDirs = ['src/main/resources/']
|
||||
}
|
||||
}
|
||||
core {
|
||||
java {
|
||||
compileClasspath += main.compileClasspath
|
||||
runtimeClasspath += main.runtimeClasspath
|
||||
srcDirs 'src/core/java/'
|
||||
}
|
||||
resources {
|
||||
srcDirs 'src/main/resources/'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
configurations {
|
||||
coreCompile.extendsFrom compile
|
||||
coreRuntime.extendsFrom runtime
|
||||
}
|
||||
|
||||
configure(install.repositories.mavenInstaller) {
|
||||
@@ -80,8 +127,8 @@ configure(install.repositories.mavenInstaller) {
|
||||
}
|
||||
|
||||
dependencies {
|
||||
compile project(":MetroLookAndFeel")
|
||||
compile project(":HMCLAPI")
|
||||
compile project(":HMCLaF")
|
||||
compile project(":HMCUtils")
|
||||
compile group: "org.commonjava.googlecode.markdown4j", name: "markdown4j", version: "2.2-cj-1.0"
|
||||
}
|
||||
|
||||
@@ -123,3 +170,4 @@ processResources {
|
||||
|
||||
build.dependsOn makeExecutable
|
||||
build.dependsOn makePackGZ
|
||||
build.dependsOn macAppCompressed
|
||||
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
+2
-3
@@ -19,7 +19,6 @@ package org.jackhuang.hellominecraft.launcher.api;
|
||||
|
||||
import org.jackhuang.hellominecraft.launcher.core.GameException;
|
||||
import org.jackhuang.hellominecraft.launcher.core.service.IMinecraftService;
|
||||
import org.jackhuang.hellominecraft.launcher.setting.Profile;
|
||||
import org.jackhuang.hellominecraft.launcher.core.auth.AuthenticationException;
|
||||
import org.jackhuang.hellominecraft.launcher.core.auth.IAuthenticator;
|
||||
import org.jackhuang.hellominecraft.launcher.core.auth.UserProfileProvider;
|
||||
@@ -35,12 +34,12 @@ public interface IPlugin {
|
||||
/**
|
||||
* You can modify the application actions by this method.
|
||||
*
|
||||
* @param profile info to the Minecraft Loader
|
||||
* @param obj minecraft service wanted
|
||||
*
|
||||
* @return For example, you can implement IMinecraftProvider to support
|
||||
* MultiMC
|
||||
*/
|
||||
IMinecraftService provideMinecraftService(Profile profile);
|
||||
IMinecraftService provideMinecraftService(Object obj);
|
||||
|
||||
/**
|
||||
* Register authenticators by calling IAuthenticator.LOGINS.add.
|
||||
+10
-7
@@ -18,7 +18,6 @@
|
||||
package org.jackhuang.hellominecraft.launcher.api;
|
||||
|
||||
import org.jackhuang.hellominecraft.util.logging.HMCLog;
|
||||
import org.jackhuang.hellominecraft.launcher.util.DefaultPlugin;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -26,17 +25,21 @@ import org.jackhuang.hellominecraft.launcher.util.DefaultPlugin;
|
||||
*/
|
||||
public class PluginManager {
|
||||
|
||||
private static IPlugin NOW_PLUGIN = new DefaultPlugin();
|
||||
private static IPlugin NOW_PLUGIN;
|
||||
|
||||
public static void getServerPlugin() {
|
||||
try {
|
||||
ClassLoader cl = Thread.currentThread().getContextClassLoader();
|
||||
Class c = cl.loadClass("org.jackhuang.hellominecraft.launcher.server.ServerPlugin");
|
||||
IPlugin p = (IPlugin) c.newInstance();
|
||||
NOW_PLUGIN = p;
|
||||
getPlugin(Thread.currentThread().getContextClassLoader().loadClass("org.jackhuang.hellominecraft.launcher.server.ServerPlugin"));
|
||||
} catch (ClassNotFoundException ignore) {
|
||||
}
|
||||
}
|
||||
|
||||
public static void getPlugin(Class<?> cls) {
|
||||
try {
|
||||
IPlugin p = (IPlugin) cls.newInstance();
|
||||
NOW_PLUGIN = p;
|
||||
} catch (Exception e) {
|
||||
HMCLog.err("Failed to new instance");
|
||||
HMCLog.err("Failed to new instance");
|
||||
}
|
||||
}
|
||||
|
||||
File renamed without changes.
File renamed without changes.
+5
@@ -17,6 +17,7 @@
|
||||
*/
|
||||
package org.jackhuang.hellominecraft.launcher.core.asset;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
import java.util.HashSet;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.Map;
|
||||
@@ -29,7 +30,11 @@ import java.util.Set;
|
||||
public class AssetsIndex {
|
||||
|
||||
public static final String DEFAULT_ASSET_NAME = "legacy";
|
||||
|
||||
@SerializedName("objects")
|
||||
public Map<String, AssetsObject> objects;
|
||||
|
||||
@SerializedName("virtual")
|
||||
public boolean virtual;
|
||||
|
||||
public AssetsIndex() {
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
+12
-2
@@ -17,14 +17,24 @@
|
||||
*/
|
||||
package org.jackhuang.hellominecraft.launcher.core.auth.yggdrasil;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
public class Response {
|
||||
|
||||
public String accessToken, clientToken;
|
||||
@SerializedName("accessToken")
|
||||
public String accessToken;
|
||||
@SerializedName("clientToken")
|
||||
public String clientToken;
|
||||
@SerializedName("selectedProfile")
|
||||
public GameProfile selectedProfile;
|
||||
@SerializedName("availableProfiles")
|
||||
public GameProfile[] availableProfiles;
|
||||
@SerializedName("user")
|
||||
public User user;
|
||||
|
||||
@SerializedName("error")
|
||||
public String error;
|
||||
@SerializedName("errorMessage")
|
||||
public String errorMessage;
|
||||
@SerializedName("cause")
|
||||
public String cause;
|
||||
}
|
||||
File renamed without changes.
File renamed without changes.
+1
-1
@@ -148,7 +148,7 @@ public class YggdrasilAuthentication {
|
||||
|
||||
if (StrUtils.isNotBlank(response.error)) {
|
||||
HMCLog.err("Failed to log in, the auth server returned an error: " + response.error + ", message: " + response.errorMessage + ", cause: " + response.cause);
|
||||
if (response.errorMessage.contains("Invalid token"))
|
||||
if (response.errorMessage != null && response.errorMessage.contains("Invalid token"))
|
||||
response.errorMessage = C.i18n("login.invalid_token");
|
||||
throw new AuthenticationException("Request error: " + response.errorMessage);
|
||||
}
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
+3
@@ -17,6 +17,7 @@
|
||||
*/
|
||||
package org.jackhuang.hellominecraft.launcher.core.download;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
import java.util.ArrayList;
|
||||
import org.jackhuang.hellominecraft.util.C;
|
||||
import org.jackhuang.hellominecraft.util.NetUtils;
|
||||
@@ -28,7 +29,9 @@ import org.jackhuang.hellominecraft.util.OverridableSwingWorker;
|
||||
*/
|
||||
public class MinecraftRemoteVersions {
|
||||
|
||||
@SerializedName("versions")
|
||||
public ArrayList<MinecraftRemoteVersion> versions;
|
||||
@SerializedName("latest")
|
||||
public MinecraftRemoteLatestVersion latest;
|
||||
|
||||
private static volatile MinecraftRemoteVersions INSTANCE = null;
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
+3
-5
@@ -18,7 +18,6 @@
|
||||
package org.jackhuang.hellominecraft.launcher.core.install.forge;
|
||||
|
||||
import org.jackhuang.hellominecraft.launcher.core.install.InstallProfile;
|
||||
import java.io.BufferedOutputStream;
|
||||
import java.io.File;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.InputStream;
|
||||
@@ -32,6 +31,7 @@ import org.jackhuang.hellominecraft.util.system.FileUtils;
|
||||
import org.jackhuang.hellominecraft.util.NetUtils;
|
||||
import org.jackhuang.hellominecraft.launcher.core.version.MinecraftLibrary;
|
||||
import org.jackhuang.hellominecraft.util.MessageBox;
|
||||
import org.jackhuang.hellominecraft.util.system.IOUtils;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -79,10 +79,8 @@ public class ForgeInstaller extends Task {
|
||||
File file = new File(gameDir, "libraries/" + forge.getDownloadInfo().path);
|
||||
if (file.getParentFile().mkdirs())
|
||||
HMCLog.warn("Failed to make library directory " + file.getParent());
|
||||
try (FileOutputStream fos = new FileOutputStream(file); BufferedOutputStream bos = new BufferedOutputStream(fos)) {
|
||||
int c;
|
||||
while ((c = is.read()) != -1)
|
||||
bos.write((byte) c);
|
||||
try (FileOutputStream fos = new FileOutputStream(file)) {
|
||||
IOUtils.copyStream(is, fos);
|
||||
}
|
||||
mp.version().refreshVersions();
|
||||
}
|
||||
File renamed without changes.
+11
@@ -17,20 +17,31 @@
|
||||
*/
|
||||
package org.jackhuang.hellominecraft.launcher.core.install.forge;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author huangyuhui
|
||||
*/
|
||||
public class Install {
|
||||
|
||||
@SerializedName("profileName")
|
||||
private String profileName;
|
||||
@SerializedName("target")
|
||||
private String target;
|
||||
@SerializedName("path")
|
||||
private String path;
|
||||
@SerializedName("version")
|
||||
private String version;
|
||||
@SerializedName("filePath")
|
||||
private String filePath;
|
||||
@SerializedName("welcome")
|
||||
private String welcome;
|
||||
@SerializedName("minecraft")
|
||||
private String minecraft;
|
||||
@SerializedName("mirrorList")
|
||||
private String mirrorList;
|
||||
@SerializedName("logo")
|
||||
private String logo;
|
||||
|
||||
public Install() {
|
||||
File renamed without changes.
File renamed without changes.
+17
-2
@@ -17,6 +17,7 @@
|
||||
*/
|
||||
package org.jackhuang.hellominecraft.launcher.core.install.forge;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
@@ -25,8 +26,22 @@ import java.util.Map;
|
||||
*/
|
||||
public class MinecraftForgeVersionRoot {
|
||||
|
||||
public String artifact, webpath, adfly, homepage, name;
|
||||
public Map<String, int[]> branches, mcversion;
|
||||
@SerializedName("artifact")
|
||||
public String artifact;
|
||||
@SerializedName("webpath")
|
||||
public String webpath;
|
||||
@SerializedName("adfly")
|
||||
public String adfly;
|
||||
@SerializedName("homepage")
|
||||
public String homepage;
|
||||
@SerializedName("name")
|
||||
public String name;
|
||||
@SerializedName("branches")
|
||||
public Map<String, int[]> branches;
|
||||
@SerializedName("mcversion")
|
||||
public Map<String, int[]> mcversion;
|
||||
@SerializedName("promos")
|
||||
public Map<String, Integer> promos;
|
||||
@SerializedName("number")
|
||||
public Map<Integer, MinecraftForgeVersion> number;
|
||||
}
|
||||
File renamed without changes.
+2
@@ -17,6 +17,7 @@
|
||||
*/
|
||||
package org.jackhuang.hellominecraft.launcher.core.install.liteloader;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
@@ -25,5 +26,6 @@ import java.util.Map;
|
||||
*/
|
||||
public class LiteLoaderMCVersions {
|
||||
|
||||
@SerializedName("artefacts")
|
||||
public Map<String, Map<String, LiteLoaderVersion>> artefacts;
|
||||
}
|
||||
+12
-1
@@ -17,6 +17,7 @@
|
||||
*/
|
||||
package org.jackhuang.hellominecraft.launcher.core.install.liteloader;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
import org.jackhuang.hellominecraft.launcher.core.version.MinecraftLibrary;
|
||||
|
||||
/**
|
||||
@@ -25,6 +26,16 @@ import org.jackhuang.hellominecraft.launcher.core.version.MinecraftLibrary;
|
||||
*/
|
||||
public class LiteLoaderVersion {
|
||||
|
||||
public String tweakClass, file, version, md5, timestamp;
|
||||
@SerializedName("tweakClass")
|
||||
public String tweakClass;
|
||||
@SerializedName("file")
|
||||
public String file;
|
||||
@SerializedName("version")
|
||||
public String version;
|
||||
@SerializedName("md5")
|
||||
public String md5;
|
||||
@SerializedName("timestamp")
|
||||
public String timestamp;
|
||||
@SerializedName("libraries")
|
||||
public MinecraftLibrary[] libraries;
|
||||
}
|
||||
File renamed without changes.
+8
-1
@@ -17,13 +17,20 @@
|
||||
*/
|
||||
package org.jackhuang.hellominecraft.launcher.core.install.liteloader;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author huangyuhui
|
||||
*/
|
||||
public class LiteLoaderVersionsMeta {
|
||||
|
||||
private String description, authors, url;
|
||||
@SerializedName("versions")
|
||||
private String description;
|
||||
@SerializedName("authors")
|
||||
private String authors;
|
||||
@SerializedName("url")
|
||||
private String url;
|
||||
|
||||
public LiteLoaderVersionsMeta() {
|
||||
}
|
||||
+3
@@ -17,6 +17,7 @@
|
||||
*/
|
||||
package org.jackhuang.hellominecraft.launcher.core.install.liteloader;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
@@ -25,6 +26,8 @@ import java.util.Map;
|
||||
*/
|
||||
public class LiteLoaderVersionsRoot {
|
||||
|
||||
@SerializedName("versions")
|
||||
public Map<String, LiteLoaderMCVersions> versions;
|
||||
@SerializedName("meta")
|
||||
public LiteLoaderVersionsMeta meta;
|
||||
}
|
||||
+2
-1
@@ -72,7 +72,8 @@ public class OptiFineInstaller extends Task implements PreviousResultRegistrar<F
|
||||
mv.mainClass = "net.minecraft.launchwrapper.Launch";
|
||||
mv.libraries.add(1, new MinecraftLibrary("net.minecraft:launchwrapper:1.7"));
|
||||
}
|
||||
mv.minecraftArguments += " --tweakClass optifine.OptiFineTweaker";
|
||||
if (!mv.minecraftArguments.contains("FMLTweaker"))
|
||||
mv.minecraftArguments += " --tweakClass optifine.OptiFineTweaker";
|
||||
}
|
||||
}
|
||||
File loc = new File(service.baseDirectory(), "versions/" + mv.id);
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
+3
-2
@@ -120,7 +120,7 @@ public class GameLauncher {
|
||||
*
|
||||
* @throws IOException failed creating process
|
||||
*/
|
||||
public void launch(List str) throws IOException {
|
||||
public void launch(List<String> str) throws IOException {
|
||||
if (!service.version().onLaunch(options.getLaunchVersion()))
|
||||
return;
|
||||
if (StrUtils.isNotBlank(options.getPrecalledCommand())) {
|
||||
@@ -133,6 +133,7 @@ public class GameLauncher {
|
||||
}
|
||||
}
|
||||
HMCLog.log("Starting process");
|
||||
HMCLog.log(str.toString());
|
||||
ProcessBuilder builder = new ProcessBuilder(str);
|
||||
if (options.getLaunchVersion() == null || service.baseDirectory() == null)
|
||||
throw new Error("Fucking bug!");
|
||||
@@ -174,7 +175,7 @@ public class GameLauncher {
|
||||
if (appdata != null) {
|
||||
writer.write("set appdata=" + appdata);
|
||||
writer.newLine();
|
||||
writer.write("cd %appdata%");
|
||||
writer.write("cd /D %appdata%");
|
||||
writer.newLine();
|
||||
}
|
||||
}
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
+20
-2
@@ -19,6 +19,7 @@ package org.jackhuang.hellominecraft.launcher.core.launch;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import org.jackhuang.hellominecraft.util.StrUtils;
|
||||
import org.jackhuang.hellominecraft.util.logging.HMCLog;
|
||||
@@ -44,9 +45,24 @@ public class MinecraftLoader extends AbstractMinecraftLoader {
|
||||
@Override
|
||||
protected void makeSelf(List<String> res) throws GameException {
|
||||
StringBuilder library = new StringBuilder("");
|
||||
ArrayList<MinecraftLibrary> opt = new ArrayList<>();
|
||||
for (MinecraftLibrary l : version.libraries)
|
||||
if (l.allow() && !l.isRequiredToUnzip())
|
||||
library.append(l.getFilePath(gameDir).getAbsolutePath()).append(File.pathSeparator);
|
||||
if (l.allow() && !l.isRequiredToUnzip()) {
|
||||
if (l.name.toLowerCase().contains("optifine")) {
|
||||
opt.add(l);
|
||||
continue;
|
||||
}
|
||||
File f = l.getFilePath(gameDir);
|
||||
if (f == null)
|
||||
continue;
|
||||
library.append(f.getAbsolutePath()).append(File.pathSeparator);
|
||||
}
|
||||
for (MinecraftLibrary l : opt) {
|
||||
File f = l.getFilePath(gameDir);
|
||||
if (f == null)
|
||||
continue;
|
||||
library.append(f.getAbsolutePath()).append(File.pathSeparator);
|
||||
}
|
||||
File f = version.getJar(service.baseDirectory());
|
||||
if (!f.exists())
|
||||
throw new GameException("Minecraft jar does not exists");
|
||||
@@ -55,6 +71,8 @@ public class MinecraftLoader extends AbstractMinecraftLoader {
|
||||
res.add(library.toString().substring(0, library.length() - File.pathSeparator.length()));
|
||||
res.add(version.mainClass);
|
||||
|
||||
if (version.minecraftArguments == null)
|
||||
throw new GameException(new NullPointerException("Minecraft Arguments can not be null."));
|
||||
String[] splitted = StrUtils.tokenize(version.minecraftArguments);
|
||||
|
||||
String game_assets = assetProvider.apply(version, !options.isNotCheckGame());
|
||||
File renamed without changes.
+21
-1
@@ -18,6 +18,7 @@
|
||||
package org.jackhuang.hellominecraft.launcher.core.mod;
|
||||
|
||||
import com.google.gson.JsonSyntaxException;
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
import com.google.gson.reflect.TypeToken;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
@@ -37,8 +38,27 @@ import org.jackhuang.hellominecraft.util.system.FileUtils;
|
||||
*/
|
||||
public class ModInfo implements Comparable<ModInfo> {
|
||||
|
||||
@SerializedName("location")
|
||||
public File location;
|
||||
public String modid, name, description, author, version, mcversion, url, updateUrl, credits;
|
||||
@SerializedName("modid")
|
||||
public String modid;
|
||||
@SerializedName("name")
|
||||
public String name;
|
||||
@SerializedName("description")
|
||||
public String description;
|
||||
@SerializedName("author")
|
||||
public String author;
|
||||
@SerializedName("version")
|
||||
public String version;
|
||||
@SerializedName("mcversion")
|
||||
public String mcversion;
|
||||
@SerializedName("url")
|
||||
public String url;
|
||||
@SerializedName("updateUrl")
|
||||
public String updateUrl;
|
||||
@SerializedName("credits")
|
||||
public String credits;
|
||||
@SerializedName("authorList")
|
||||
public String[] authorList;
|
||||
|
||||
public boolean isActive() {
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
+2
@@ -17,6 +17,7 @@
|
||||
*/
|
||||
package org.jackhuang.hellominecraft.launcher.core.version;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import org.jackhuang.hellominecraft.util.StrUtils;
|
||||
@@ -27,6 +28,7 @@ import org.jackhuang.hellominecraft.util.StrUtils;
|
||||
*/
|
||||
public class Extract implements Cloneable {
|
||||
|
||||
@SerializedName("exclude")
|
||||
public List<String> exclude = new ArrayList<>();
|
||||
|
||||
public boolean allow(String path) {
|
||||
File renamed without changes.
+4
@@ -17,6 +17,7 @@
|
||||
*/
|
||||
package org.jackhuang.hellominecraft.launcher.core.version;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
import org.jackhuang.hellominecraft.launcher.core.download.DownloadType;
|
||||
|
||||
/**
|
||||
@@ -25,8 +26,11 @@ import org.jackhuang.hellominecraft.launcher.core.download.DownloadType;
|
||||
*/
|
||||
public class GameDownloadInfo implements Cloneable {
|
||||
|
||||
@SerializedName("sha1")
|
||||
public String sha1;
|
||||
@SerializedName("size")
|
||||
public int size;
|
||||
@SerializedName("url")
|
||||
protected String url;
|
||||
|
||||
/**
|
||||
File renamed without changes.
+3
@@ -17,6 +17,7 @@
|
||||
*/
|
||||
package org.jackhuang.hellominecraft.launcher.core.version;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
@@ -25,6 +26,8 @@ import java.util.Map;
|
||||
*/
|
||||
public class LibrariesDownloadInfo {
|
||||
|
||||
@SerializedName("classifiers")
|
||||
Map<String, LibraryDownloadInfo> classifiers;
|
||||
@SerializedName("artifact")
|
||||
LibraryDownloadInfo artifact;
|
||||
}
|
||||
+3
@@ -17,6 +17,7 @@
|
||||
*/
|
||||
package org.jackhuang.hellominecraft.launcher.core.version;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
import org.jackhuang.hellominecraft.launcher.core.download.DownloadType;
|
||||
import org.jackhuang.hellominecraft.util.StrUtils;
|
||||
import org.jackhuang.hellominecraft.util.system.IOUtils;
|
||||
@@ -27,7 +28,9 @@ import org.jackhuang.hellominecraft.util.system.IOUtils;
|
||||
*/
|
||||
public class LibraryDownloadInfo extends GameDownloadInfo {
|
||||
|
||||
@SerializedName("path")
|
||||
public String path;
|
||||
@SerializedName("forgeURL")
|
||||
public String forgeURL;
|
||||
|
||||
@Override
|
||||
File renamed without changes.
+10
-1
@@ -17,6 +17,7 @@
|
||||
*/
|
||||
package org.jackhuang.hellominecraft.launcher.core.version;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
@@ -30,10 +31,15 @@ import org.jackhuang.hellominecraft.util.StrUtils;
|
||||
*/
|
||||
public class MinecraftLibrary extends IMinecraftLibrary {
|
||||
|
||||
@SerializedName("rules")
|
||||
public ArrayList<Rules> rules;
|
||||
@SerializedName("url")
|
||||
public String url;
|
||||
@SerializedName("natives")
|
||||
public Natives natives;
|
||||
@SerializedName("extract")
|
||||
public Extract extract;
|
||||
@SerializedName("downloads")
|
||||
public LibrariesDownloadInfo downloads;
|
||||
|
||||
public MinecraftLibrary(String name) {
|
||||
@@ -99,7 +105,10 @@ public class MinecraftLibrary extends IMinecraftLibrary {
|
||||
|
||||
@Override
|
||||
public File getFilePath(File gameDir) {
|
||||
return new File(gameDir, "libraries/" + getDownloadInfo().path);
|
||||
LibraryDownloadInfo info = getDownloadInfo();
|
||||
if (info == null)
|
||||
return null;
|
||||
return new File(gameDir, "libraries/" + info.path);
|
||||
}
|
||||
|
||||
@Override
|
||||
File renamed without changes.
+27
-3
@@ -17,6 +17,7 @@
|
||||
*/
|
||||
package org.jackhuang.hellominecraft.launcher.core.version;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
@@ -37,14 +38,37 @@ import org.jackhuang.hellominecraft.util.Utils;
|
||||
*/
|
||||
public class MinecraftVersion implements Cloneable, Comparable<MinecraftVersion> {
|
||||
|
||||
public String minecraftArguments, mainClass, time, id, type, processArguments,
|
||||
releaseTime, jar, inheritsFrom, runDir;
|
||||
@SerializedName("minecraftArguments")
|
||||
public String minecraftArguments;
|
||||
@SerializedName("mainClass")
|
||||
public String mainClass;
|
||||
@SerializedName("time")
|
||||
public String time;
|
||||
@SerializedName("id")
|
||||
public String id;
|
||||
@SerializedName("type")
|
||||
public String type;
|
||||
@SerializedName("processArguments")
|
||||
public String processArguments;
|
||||
@SerializedName("releaseTime")
|
||||
public String releaseTime;
|
||||
@SerializedName("jar")
|
||||
public String jar;
|
||||
@SerializedName("inheritsFrom")
|
||||
public String inheritsFrom;
|
||||
@SerializedName("runDir")
|
||||
public String runDir;
|
||||
@SerializedName("assets")
|
||||
protected String assets;
|
||||
@SerializedName("minimumLauncherVersion")
|
||||
public int minimumLauncherVersion;
|
||||
@SerializedName("hidden")
|
||||
public boolean hidden;
|
||||
@SerializedName("assetIndex")
|
||||
public AssetIndexDownloadInfo assetIndex;
|
||||
@SerializedName("downloads")
|
||||
private Map<String, GameDownloadInfo> downloads;
|
||||
|
||||
@SerializedName("libraries")
|
||||
public ArrayList<MinecraftLibrary> libraries;
|
||||
|
||||
public MinecraftVersion() {
|
||||
File renamed without changes.
+8
-1
@@ -17,13 +17,20 @@
|
||||
*/
|
||||
package org.jackhuang.hellominecraft.launcher.core.version;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author huangyuhui
|
||||
*/
|
||||
public class Natives implements Cloneable {
|
||||
|
||||
public String windows, osx, linux;
|
||||
@SerializedName("windows")
|
||||
public String windows;
|
||||
@SerializedName("osx")
|
||||
public String osx;
|
||||
@SerializedName("linux")
|
||||
public String linux;
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("CloneDeclaresCloneNotSupported")
|
||||
+5
-1
@@ -17,6 +17,7 @@
|
||||
*/
|
||||
package org.jackhuang.hellominecraft.launcher.core.version;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
import org.jackhuang.hellominecraft.util.StrUtils;
|
||||
import org.jackhuang.hellominecraft.util.system.OS;
|
||||
|
||||
@@ -26,7 +27,10 @@ import org.jackhuang.hellominecraft.util.system.OS;
|
||||
*/
|
||||
public class OSRestriction {
|
||||
|
||||
private String version, name;
|
||||
@SerializedName("version")
|
||||
private String version;
|
||||
@SerializedName("name")
|
||||
public String name;
|
||||
|
||||
public String getVersion() {
|
||||
return version;
|
||||
Loaded 100 of 313 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user