Исправления DownloadClientCommand и стандартных профилей 1.12.2 и 1.7.10

This commit is contained in:
Gravit 2018-12-24 14:58:28 +07:00
parent c65124a21e
commit f58d387d92
No known key found for this signature in database
GPG key ID: 061981E1E85D3216
5 changed files with 66 additions and 87 deletions

View file

@ -36,7 +36,7 @@ public void invoke(String... args) throws Exception {
CommonHelper.newThread("Netty Server", true, handler).start(); CommonHelper.newThread("Netty Server", true, handler).start();
} }
if (args[0].equals("profile")) { if (args[0].equals("profile")) {
ClientProfile profile = new ClientProfile("1.7.10","asset1.7.10",0,"Test1.7.10","localhost",25535,true,false,"net.minecraft.launchwrapper.Launch"); ClientProfile profile = new ClientProfile("1.7.10","asset1.7.10",0,"Test1.7.10","localhost",25565,true,false,"net.minecraft.launchwrapper.Launch");
try(Writer writer = IOHelper.newWriter(LaunchServer.server.dir.resolve("profiles").resolve("Test.cfg"))) try(Writer writer = IOHelper.newWriter(LaunchServer.server.dir.resolve("profiles").resolve("Test.cfg")))
{ {
Launcher.gson.toJson(profile,writer); Launcher.gson.toJson(profile,writer);

View file

@ -56,6 +56,7 @@ public void invoke(String... args) throws IOException, CommandException {
client = Launcher.gson.fromJson(reader,ClientProfile.class); client = Launcher.gson.fromJson(reader,ClientProfile.class);
} }
client.setTitle(dirName); client.setTitle(dirName);
client.setDir(dirName);
try (BufferedWriter writer = IOHelper.newWriter(IOHelper.resolveIncremental(server.profilesDir, try (BufferedWriter writer = IOHelper.newWriter(IOHelper.resolveIncremental(server.profilesDir,
dirName, "cfg"))) { dirName, "cfg"))) {
Launcher.gson.toJson(client,writer); Launcher.gson.toJson(client,writer);

View file

@ -1,50 +1,41 @@
version: "1.12.2"; {
assetIndex: "1.12.2"; # 1.7.10+ only "version": "1.12.2",
"assetIndex": "1.12.2",
# Runtime-dependent params "assetDir": "asset1.12",
dir: "XXXXX"; "dir": "HiTech",
assetDir: "asset1.12"; "sortIndex": 0,
"title": "xxxxxxxx",
# Client params "serverAddress": "localhost",
sortIndex: 0; "serverPort": 25565,
title: "XXXXX"; "update": ["servers.dat"],
serverAddress: "server.tld"; "updateExclusions": [
serverPort: 25565; "mods/OpenSecurity",
"mods/VoxelMods",
# Updater and client watch service "mods/railcraft"
updateFastCheck: true; ],
update: [ "updateShared": [],
"servers.dat" "updateVerify": [
]; "libraries", "natives", "mods",
updateVerify: [ "minecraft.jar", "forge.jar", "liteloader.jar"
"libraries", "natives", "mods", ],
"minecraft.jar", "forge.jar", "liteloader.jar" "updateOptional": [
]; ],
updateExclusions: []; "updateFastCheck": true,
updateShared: []; "useWhitelist": false,
updateOptional: []; "mainClass": "net.minecraft.launchwrapper.Launch",
enabledOptional: []; "jvmArgs": [
useWhitelist: false;
whitelist: [];
# Client launcher params
mainClass: "net.minecraft.launchwrapper.Launch";
classPath: [ "forge.jar", "liteloader.jar", "minecraft.jar", "libraries" ];
jvmArgs: [
"-Dfml.ignorePatchDiscrepancies=true", "-Dfml.ignorePatchDiscrepancies=true",
"-Dfml.ignoreInvalidMinecraftCertificates=true", "-Dfml.ignoreInvalidMinecraftCertificates=true",
# Some options from Mojang's launcher
"-XX:+UseConcMarkSweepGC", "-XX:+UseConcMarkSweepGC",
"-XX:+CMSIncrementalMode", "-XX:+CMSIncrementalMode",
"-XX:-UseAdaptiveSizePolicy", "-XX:-UseAdaptiveSizePolicy",
"-Xmn128M", "-Xmn128M",
# JVM Attach protection
"-XX:+DisableAttachMechanism" "-XX:+DisableAttachMechanism"
]; ],
clientArgs: [ "classPath": ["forge.jar", "liteloader.jar", "minecraft.jar", "libraries"],
"clientArgs": [
"--tweakClass", "net.minecraftforge.fml.common.launcher.FMLTweaker", "--tweakClass", "net.minecraftforge.fml.common.launcher.FMLTweaker",
"--tweakClass", "com.mumfrey.liteloader.launch.LiteLoaderTweaker" "--tweakClass", "com.mumfrey.liteloader.launch.LiteLoaderTweaker"
]; ],
"whitelist": []
}

View file

@ -1,54 +1,37 @@
version: "1.7.10"; {
assetIndex: "1.7.10"; # 1.7.10+ only "version": "1.7.10",
"assetIndex": "1.7.10",
# Runtime-dependent params "assetDir": "asset1.7.10",
dir: "XXXXX"; "dir": "xxxxxxx",
assetDir: "asset1.7.10"; "sortIndex": 0,
"title": "Test1.7.10",
# Client params "serverAddress": "localhost",
sortIndex: 0; "serverPort": 25565,
title: "XXXXX"; "update": ["servers.dat"],
serverAddress: "server.tld"; "updateExclusions": [],
serverPort: 25565; "updateShared": [],
"updateVerify": [
# Updater and client watch service "libraries", "natives", "mods",
updateFastCheck: true; "minecraft.jar", "forge.jar", "liteloader.jar"
update: [ ],
"servers.dat" "updateOptional": [
]; ],
updateVerify: [ "updateFastCheck": true,
"libraries", "natives", "mods", "useWhitelist": false,
"minecraft.jar", "forge.jar", "liteloader.jar" "mainClass": "net.minecraft.launchwrapper.Launch",
]; "jvmArgs": [
updateExclusions: [
# "mods/carpentersblocks",
# "mods/ic2",
# "mods/railcraft"
];
updateShared: [];
updateOptional: [];
enabledOptional: [];
useWhitelist: false;
whitelist: [];
# Client launcher params
mainClass: "net.minecraft.launchwrapper.Launch";
classPath: [ "forge.jar", "liteloader.jar", "minecraft.jar", "libraries" ];
jvmArgs: [
"-Dfml.ignorePatchDiscrepancies=true", "-Dfml.ignorePatchDiscrepancies=true",
"-Dfml.ignoreInvalidMinecraftCertificates=true", "-Dfml.ignoreInvalidMinecraftCertificates=true",
# Some options from Mojang's launcher
"-XX:+UseConcMarkSweepGC", "-XX:+UseConcMarkSweepGC",
"-XX:+CMSIncrementalMode", "-XX:+CMSIncrementalMode",
"-XX:-UseAdaptiveSizePolicy", "-XX:-UseAdaptiveSizePolicy",
"-Xmn128M", "-Xmn128M",
# JVM Attach protection
"-XX:+DisableAttachMechanism" "-XX:+DisableAttachMechanism"
]; ],
clientArgs: [ "classPath": ["forge.jar", "liteloader.jar", "minecraft.jar", "libraries"],
"clientArgs": [
"--tweakClass", "cpw.mods.fml.common.launcher.FMLTweaker", "--tweakClass", "cpw.mods.fml.common.launcher.FMLTweaker",
"--tweakClass", "com.mumfrey.liteloader.launch.LiteLoaderTweaker" "--tweakClass", "com.mumfrey.liteloader.launch.LiteLoaderTweaker"
]; ],
"whitelist": []
}

View file

@ -179,6 +179,10 @@ public String[] getClientArgs() {
public String getDir() { public String getDir() {
return dir; return dir;
} }
public void setDir(String dir) {
this.dir = dir;
}
@LauncherAPI @LauncherAPI
public String getAssetDir() { public String getAssetDir() {
return assetDir; return assetDir;