Supplements: 'SerializedName'
This commit is contained in:
@@ -47,6 +47,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
|
||||
|
||||
@@ -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() {
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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() {
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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() {
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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() {
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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;
|
||||
|
||||
/**
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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() {
|
||||
|
||||
@@ -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")
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -17,13 +17,17 @@
|
||||
*/
|
||||
package org.jackhuang.hellominecraft.launcher.core.version;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author huangyuhui
|
||||
*/
|
||||
public class Rules {
|
||||
|
||||
@SerializedName("action")
|
||||
private String action;
|
||||
@SerializedName("os")
|
||||
private OSRestriction os;
|
||||
|
||||
public Rules() {
|
||||
|
||||
@@ -43,7 +43,14 @@ public final class Config implements Cloneable {
|
||||
private String bgpath;
|
||||
@SerializedName("clientToken")
|
||||
private final String clientToken;
|
||||
private String proxyHost, proxyPort, proxyUserName, proxyPassword;
|
||||
@SerializedName("proxyHost")
|
||||
private String proxyHost;
|
||||
@SerializedName("proxyPort")
|
||||
private String proxyPort;
|
||||
@SerializedName("proxyUserName")
|
||||
private String proxyUserName;
|
||||
@SerializedName("proxyPassword")
|
||||
private String proxyPassword;
|
||||
@SerializedName("enableShadow")
|
||||
private boolean enableShadow;
|
||||
@SerializedName("decorated")
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
*/
|
||||
package org.jackhuang.hellominecraft.launcher.setting;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import org.jackhuang.hellominecraft.launcher.Main;
|
||||
@@ -39,21 +40,48 @@ public class VersionSetting {
|
||||
|
||||
public transient String id;
|
||||
|
||||
private String javaArgs, minecraftArgs, maxMemory, permSize, width, height;
|
||||
private String javaDir, precalledCommand, serverIp, java, wrapper;
|
||||
private boolean fullscreen, noJVMArgs, notCheckGame;
|
||||
@SerializedName("javaArgs")
|
||||
private String javaArgs;
|
||||
@SerializedName("minecraftArgs")
|
||||
private String minecraftArgs;
|
||||
@SerializedName("maxMemory")
|
||||
private String maxMemory;
|
||||
@SerializedName("permSize")
|
||||
private String permSize;
|
||||
@SerializedName("width")
|
||||
private String width;
|
||||
@SerializedName("height")
|
||||
private String height;
|
||||
@SerializedName("javaDir")
|
||||
private String javaDir;
|
||||
@SerializedName("precalledCommand")
|
||||
private String precalledCommand;
|
||||
@SerializedName("serverIp")
|
||||
private String serverIp;
|
||||
@SerializedName("java")
|
||||
private String java;
|
||||
@SerializedName("wrapper")
|
||||
private String wrapper;
|
||||
@SerializedName("fullscreen")
|
||||
private boolean fullscreen;
|
||||
@SerializedName("noJVMArgs")
|
||||
private boolean noJVMArgs;
|
||||
@SerializedName("notCheckGame")
|
||||
private boolean notCheckGame;
|
||||
|
||||
/**
|
||||
* 0 - Close the launcher when the game starts.<br/>
|
||||
* 1 - Hide the launcher when the game starts.<br/>
|
||||
* 2 - Keep the launcher open.<br/>
|
||||
*/
|
||||
@SerializedName("launcherVisibility")
|
||||
private int launcherVisibility;
|
||||
|
||||
/**
|
||||
* 0 - .minecraft<br/>
|
||||
* 1 - .minecraft/versions/<version>/<br/>
|
||||
*/
|
||||
@SerializedName("gameDirType")
|
||||
private int gameDirType;
|
||||
|
||||
public transient final EventHandler<String> propertyChanged = new EventHandler<>(this);
|
||||
|
||||
@@ -17,12 +17,17 @@
|
||||
*/
|
||||
package org.jackhuang.hellominecraft.svrmgr.util.version;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author huangyuhui
|
||||
*/
|
||||
public class MinecraftRemoteLatestVersion {
|
||||
|
||||
public String snapshot, release;
|
||||
@SerializedName("snapshot")
|
||||
public String snapshot;
|
||||
@SerializedName("release")
|
||||
public String release;
|
||||
|
||||
}
|
||||
|
||||
@@ -17,12 +17,21 @@
|
||||
*/
|
||||
package org.jackhuang.hellominecraft.svrmgr.util.version;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author huangyuhui
|
||||
*/
|
||||
public class MinecraftRemoteVersion {
|
||||
|
||||
public String id, time, releaseTime, type;
|
||||
@SerializedName("id")
|
||||
public String id;
|
||||
@SerializedName("time")
|
||||
public String time;
|
||||
@SerializedName("releaseTime")
|
||||
public String releaseTime;
|
||||
@SerializedName("type")
|
||||
public String type;
|
||||
|
||||
}
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
*/
|
||||
package org.jackhuang.hellominecraft.svrmgr.util.version;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
import java.util.ArrayList;
|
||||
|
||||
/**
|
||||
@@ -25,7 +26,9 @@ import java.util.ArrayList;
|
||||
*/
|
||||
public class MinecraftRemoteVersions {
|
||||
|
||||
@SerializedName("versions")
|
||||
public ArrayList<MinecraftRemoteVersion> versions;
|
||||
@SerializedName("latest")
|
||||
public MinecraftRemoteLatestVersion latest;
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user