launcher_profiles.json, Hold slot item of hotbar to drop

This commit is contained in:
khanhduytran0 2020-04-10 08:56:03 +07:00
parent 8b64eb8abc
commit 0d04a1ab1b
9 changed files with 81 additions and 20 deletions

Binary file not shown.

View File

@ -0,0 +1,34 @@
package net.kdt.pojavlaunch.value.launcherprofiles;
import com.google.gson.*;
import net.kdt.pojavlaunch.*;
import java.io.*;
public class LauncherProfiles
{
public static MinecraftLauncherProfiles mainProfileJson;
public static File launcherProfilesFile = new File(Tools.MAIN_PATH + "/launcher_profiles.json");
public static MinecraftLauncherProfiles getJson() {
try {
if (launcherProfilesFile.exists()) {
if (mainProfileJson == null) {
mainProfileJson = new Gson().fromJson(Tools.read(launcherProfilesFile.getAbsolutePath()), MinecraftLauncherProfiles.class);
}
} else {
mainProfileJson = new MinecraftLauncherProfiles();
}
insertMissing();
return mainProfileJson;
} catch (Throwable th) {
throw new RuntimeException(th);
}
}
public static String insert
private static void insertMissing() {
if (mainProfileJson.authenticationDatabase == null) {
MinecraftAuthenticationDatabase mad = new MinecraftAuthenticationDatabase();
mainProfileJson.authenticationDatabase = mad;
}
}
}

View File

@ -2,7 +2,7 @@ package net.kdt.pojavlaunch.value.launcherprofiles;
public class MinecraftAuthenticationDatabase
{
public static String accessToken;
public static String username;
public static MinecraftProfile[] profiles;
public String accessToken;
public String username;
public MinecraftProfile[] profiles;
}

View File

@ -2,7 +2,12 @@ package net.kdt.pojavlaunch.value.launcherprofiles;
public class MinecraftLauncherProfiles
{
public static MinecraftProfile[] profiles;
public static String clientToken;
public static MinecraftAuthenticationDatabase authenticationDatabase;
public MinecraftProfile[] profiles;
public String clientToken;
public MinecraftAuthenticationDatabase[] authenticationDatabase;
// public Map launcherVersion;
public MinecraftLauncherSettings settings;
// public Map analyticsToken;
public int analyticsFailcount;
public MinecraftSelectedUser selectedUser;
}

View File

@ -0,0 +1,15 @@
package net.kdt.pojavlaunch.value.launcherprofiles;
public class MinecraftLauncherSettings
{
public boolean enableSnapshots;
public boolean enableAdvanced;
public boolean keepLauncherOpen;
public boolean showGameLog;
public String locale;
public boolean showMenu;
public boolean enableHistorical;
public String profileSorting;
public boolean crashAssistance;
public boolean enableAnalytics;
}

View File

@ -2,16 +2,16 @@ package net.kdt.pojavlaunch.value.launcherprofiles;
public class MinecraftProfile
{
public static String name;
public static String type;
public static String created;
public static String lastUsed;
public static String icon;
public static String lastVersionId;
public static String gameDir;
public static String javaDir;
public static String javaArgs;
public static String logConfig;
public static boolean logConfigIsXML;
public static MinecraftResolution[]resolution;
public String name;
public String type;
public String created;
public String lastUsed;
public String icon;
public String lastVersionId;
public String gameDir;
public String javaDir;
public String javaArgs;
public String logConfig;
public boolean logConfigIsXML;
public MinecraftResolution[] resolution;
}

View File

@ -2,6 +2,6 @@ package net.kdt.pojavlaunch.value.launcherprofiles;
public class MinecraftResolution
{
public static int width;
public static int height;
public int width;
public int height;
}

View File

@ -0,0 +1,7 @@
package net.kdt.pojavlaunch.value.launcherprofiles;
public class MinecraftSelectedUser
{
public String account;
public String profile;
}