Skip to content
This repository has been archived by the owner on Dec 21, 2024. It is now read-only.

Commit

Permalink
Fix installer
Browse files Browse the repository at this point in the history
  • Loading branch information
Mgazul committed Mar 29, 2024
1 parent c74b369 commit 32e7242
Show file tree
Hide file tree
Showing 5 changed files with 52 additions and 10 deletions.
1 change: 0 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,6 @@ project(':mohist') {
fmllauncherImplementation.extendsFrom(installer, implementation)
}
dependencies {
installer 'net.minecraftforge:srgutils:0.5.4'
installer 'org.ow2.asm:asm:' + ASM_VERSION
installer 'org.ow2.asm:asm-commons:' + ASM_VERSION
installer 'org.ow2.asm:asm-tree:' + ASM_VERSION
Expand Down
2 changes: 1 addition & 1 deletion buildSrc/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ repositories {
dependencies {
implementation 'org.ow2.asm:asm:9.6'
implementation 'org.ow2.asm:asm-tree:9.6'
implementation 'net.minecraftforge:srgutils:0.5.+'
implementation 'net.minecraftforge:srgutils:0.4.+'
implementation 'commons-io:commons-io:2.12.0'
implementation 'com.google.code.gson:gson:2.10'
}
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public static void run() {
LinkedHashMap<File, String> libs = getDefaultLibs();
AtomicLong currentSize = new AtomicLong();
Set<File> defaultLibs = new LinkedHashSet<>();
for (File lib : getDefaultLibs().keySet()) {
for (File lib : libs.keySet()) {
if (lib.exists() && MohistConfigUtil.getString(MohistConfigUtil.mohistyml, "libraries_black_list:", "xxxxx").contains(lib.getName())) {
continue;
}
Expand Down
47 changes: 43 additions & 4 deletions src/fmllauncher/java/com/mohistmc/util/InstallUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,20 @@ public static void startInstallation() throws Exception {

System.out.println(i18n.get("installation.mcp"));
mute();
run("net.minecraftforge.installertools.ConsoleTool", new ArrayList<>(Arrays.asList("--task", "MCP_DATA", "--input", mcpZip.getAbsolutePath(), "--output", mcpTxt.getAbsolutePath(), "--key", "mappings")), stringToUrl(new ArrayList<>(Arrays.asList(libPath + "net/minecraftforge/installertools/1.3.0/installertools-1.3.0.jar", libPath + "net/md-5/SpecialSource/1.8.5/SpecialSource-1.8.5.jar", libPath + "net/sf/jopt-simple/jopt-simple/5.0.4/jopt-simple-5.0.4.jar", libPath + "com/google/code/gson/gson/2.10/gson-2.10.jar", libPath + "de/siegmar/fastcsv/1.0.2/fastcsv-1.0.2.jar", libPath + "org/ow2/asm/asm-commons/9.6/asm-commons-9.6.jar", libPath + "com/google/guava/guava/20.0/guava-20.0.jar", libPath + "net/sf/opencsv/opencsv/2.3/opencsv-2.3.jar", libPath + "org/ow2/asm/asm-analysis/9.6/asm-analysis-9.6.jar", libPath + "org/ow2/asm/asm-tree/9.6/asm-tree-9.6.jar", libPath + "org/ow2/asm/asm/9.6/asm-9.6.jar"))));
run("net.minecraftforge.installertools.ConsoleTool", new ArrayList<>(Arrays.asList("--task", "MCP_DATA", "--input", mcpZip.getAbsolutePath(), "--output", mcpTxt.getAbsolutePath(), "--key", "mappings")),
stringToUrl(new ArrayList<>(Arrays.asList(
libPath + "net/minecraftforge/srgutils/0.4.11/srgutils-0.4.11.jar",
libPath + "net/minecraftforge/installertools/1.3.0/installertools-1.3.0.jar",
libPath + "net/md-5/SpecialSource/1.8.5/SpecialSource-1.8.5.jar",
libPath + "net/sf/jopt-simple/jopt-simple/5.0.4/jopt-simple-5.0.4.jar",
libPath + "com/google/code/gson/gson/2.10/gson-2.10.jar",
libPath + "de/siegmar/fastcsv/1.0.2/fastcsv-1.0.2.jar",
libPath + "org/ow2/asm/asm-commons/9.6/asm-commons-9.6.jar",
libPath + "com/google/guava/guava/20.0/guava-20.0.jar",
libPath + "com/opencsv/opencsv/4.4/opencsv-4.4.jar",
libPath + "org/ow2/asm/asm-analysis/9.6/asm-analysis-9.6.jar",
libPath + "org/ow2/asm/asm-tree/9.6/asm-tree-9.6.jar",
libPath + "org/ow2/asm/asm/9.6/asm-9.6.jar"))));
unmute();
}
} else {
Expand All @@ -90,13 +103,26 @@ public static void startInstallation() throws Exception {
if(!slim.exists() || !extra.exists()) {
System.out.println(i18n.get("installation.jars"));
mute();
run("net.minecraftforge.jarsplitter.ConsoleTool", new ArrayList<>(Arrays.asList("--input", libPath + "minecraft_server.1.16.5.jar", "--slim", slim.getAbsolutePath(), "--extra", extra.getAbsolutePath(), "--srg", mcpTxt.getAbsolutePath())), stringToUrl(new ArrayList<>(Arrays.asList(libPath + "net/minecraftforge/jarsplitter/1.1.2/jarsplitter-1.1.2.jar", libPath + "net/sf/jopt-simple/jopt-simple/5.0.4/jopt-simple-5.0.4.jar"))));
run("net.minecraftforge.jarsplitter.ConsoleTool", new ArrayList<>(Arrays.asList("--input", libPath + "minecraft_server.1.16.5.jar", "--slim", slim.getAbsolutePath(), "--extra", extra.getAbsolutePath(), "--srg", mcpTxt.getAbsolutePath())),
stringToUrl(Arrays.asList(
libPath + "net/minecraftforge/jarsplitter/1.1.4/jarsplitter-1.1.4.jar",
libPath + "net/minecraftforge/srgutils/0.4.11/srgutils-0.4.11.jar",
libPath + "net/sf/jopt-simple/jopt-simple/5.0.4/jopt-simple-5.0.4.jar")));
unmute();
}

if(!srg.exists()) {
System.out.println(i18n.get("installation.srgjar"));
run("net.md_5.specialsource.SpecialSource", new ArrayList<>(Arrays.asList("--in-jar", slim.getAbsolutePath(), "--out-jar", srg.getAbsolutePath(), "--srg-in", mcpTxt.getAbsolutePath())), stringToUrl(new ArrayList<>(Arrays.asList(libPath + "net/md-5/SpecialSource/1.8.5/SpecialSource-1.8.5.jar", libPath + "org/ow2/asm/asm-commons/6.1.1/asm-commons-6.1.1.jar", libPath + "net/sf/jopt-simple/jopt-simple/5.0.4/jopt-simple-5.0.4.jar", libPath + "com/google/guava/guava/20.0/guava-20.0.jar", libPath + "net/sf/opencsv/opencsv/2.3/opencsv-2.3.jar", libPath + "org/ow2/asm/asm-analysis/6.1.1/asm-analysis-6.1.1.jar", libPath + "org/ow2/asm/asm-tree/6.1.1/asm-tree-6.1.1.jar", libPath + "org/ow2/asm/asm/6.1.1/asm-6.1.1.jar"))));
run("net.md_5.specialsource.SpecialSource", new ArrayList<>(Arrays.asList("--in-jar", slim.getAbsolutePath(), "--out-jar", srg.getAbsolutePath(), "--srg-in", mcpTxt.getAbsolutePath())),
stringToUrl(Arrays.asList(
libPath + "net/md-5/SpecialSource/1.8.5/SpecialSource-1.8.5.jar",
libPath + "org/ow2/asm/asm-commons/6.1.1/asm-commons-6.1.1.jar",
libPath + "net/sf/jopt-simple/jopt-simple/5.0.4/jopt-simple-5.0.4.jar",
libPath + "com/google/guava/guava/20.0/guava-20.0.jar",
libPath + "net/sf/opencsv/opencsv/4.4/opencsv-4.4.jar",
libPath + "org/ow2/asm/asm-analysis/6.1.1/asm-analysis-6.1.1.jar",
libPath + "org/ow2/asm/asm-tree/6.1.1/asm-tree-6.1.1.jar",
libPath + "org/ow2/asm/asm/6.1.1/asm-6.1.1.jar")));
}

String storedServerMD5 = null;
Expand All @@ -119,7 +145,20 @@ public static void startInstallation() throws Exception {
|| !storedMohistMD5.equals(mohistMD5)) {
System.out.println(i18n.get("installation.forgejar"));
mute();
run("net.minecraftforge.binarypatcher.ConsoleTool", new ArrayList<>(Arrays.asList("--clean", srg.getAbsolutePath(), "--output", serverJar.getAbsolutePath(), "--apply", lzma.getAbsolutePath())), stringToUrl(new ArrayList<>(Arrays.asList(libPath + "net/minecraftforge/binarypatcher/1.0.12/binarypatcher-1.0.12.jar", libPath + "commons-io/commons-io/2.4/commons-io-2.4.jar", libPath + "com/google/guava/guava/25.1-jre/guava-25.1-jre.jar", libPath + "net/sf/jopt-simple/jopt-simple/5.0.4/jopt-simple-5.0.4.jar", libPath + "com/github/jponge/lzma-java/1.3/lzma-java-1.3.jar", libPath + "com/nothome/javaxdelta/2.0.1/javaxdelta-2.0.1.jar", libPath + "com/google/code/findbugs/jsr305/3.0.2/jsr305-3.0.2.jar", libPath + "org/checkerframework/checker-qual/2.0.0/checker-qual-2.0.0.jar", libPath + "com/google/errorprone/error_prone_annotations/2.1.3/error_prone_annotations-2.1.3.jar", libPath + "com/google/j2objc/j2objc-annotations/1.1/j2objc-annotations-1.1.jar", libPath + "org/codehaus/mojo/animal-sniffer-annotations/1.14/animal-sniffer-annotations-1.14.jar", libPath + "trove/trove/1.0.2/trove-1.0.2.jar"))));
run("net.minecraftforge.binarypatcher.ConsoleTool", new ArrayList<>(Arrays.asList("--clean", srg.getAbsolutePath(), "--output", serverJar.getAbsolutePath(), "--apply", lzma.getAbsolutePath())),
stringToUrl(new ArrayList<>(Arrays.asList(
libPath + "net/minecraftforge/binarypatcher/1.0.12/binarypatcher-1.0.12.jar",
libPath + "commons-io/commons-io/2.4/commons-io-2.4.jar",
libPath + "com/google/guava/guava/20.0-jre/guava-20.0-jre.jar",
libPath + "net/sf/jopt-simple/jopt-simple/5.0.4/jopt-simple-5.0.4.jar",
libPath + "com/github/jponge/lzma-java/1.3/lzma-java-1.3.jar",
libPath + "com/nothome/javaxdelta/2.0.1/javaxdelta-2.0.1.jar",
libPath + "com/google/code/findbugs/jsr305/3.0.2/jsr305-3.0.2.jar",
libPath + "org/checkerframework/checker-qual/2.0.0/checker-qual-2.0.0.jar",
libPath + "com/google/errorprone/error_prone_annotations/2.1.3/error_prone_annotations-2.1.3.jar",
libPath + "com/google/j2objc/j2objc-annotations/1.1/j2objc-annotations-1.1.jar",
libPath + "org/codehaus/mojo/animal-sniffer-annotations/1.14/animal-sniffer-annotations-1.14.jar",
libPath + "trove/trove/1.0.2/trove-1.0.2.jar"))));
unmute();
serverMD5 = MD5Util.getMd5(serverJar);
}
Expand Down
10 changes: 7 additions & 3 deletions src/fmllauncher/resources/libraries.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ libraries/com/google/code/findbugs/jsr305/3.0.2/jsr305-3.0.2.jar|dd83accb899363c
libraries/com/google/code/gson/gson/2.10/gson-2.10.jar|76644f361fe16dc8026486635d157b39|286235
libraries/com/google/errorprone/error_prone_annotations/2.1.3/error_prone_annotations-2.1.3.jar|97504b36cf871722d81a4b9e114f2a16|13704
libraries/com/google/guava/guava/20.0/guava-20.0.jar|f32a8a2524620dbecc9f6bf6a20c293f|2442625
libraries/com/google/guava/guava/25.1-jre/guava-25.1-jre.jar|da3838847d109ac435f0d3ed4ae1c794|2734339
libraries/com/google/j2objc/j2objc-annotations/1.1/j2objc-annotations-1.1.jar|49ae3204bb0bb9b2ac77062641f4a6d7|8782
libraries/com/googlecode/json-simple/json-simple/1.1.1/json-simple-1.1.1.jar|5cc2c478d73e8454b4c369cee66c5bc7|23931
libraries/com/nothome/javaxdelta/2.0.1/javaxdelta-2.0.1.jar|02058f3edd701db5a5230a427b9e8979|38995
Expand All @@ -29,12 +28,13 @@ libraries/net/minecraftforge/coremods/4.0.6/coremods-4.0.6.jar|e56551f2586d3ff08
libraries/net/minecraftforge/eventbus/4.0.0/eventbus-4.0.0.jar|84c4758e6139b70146104be5bb1300b5|42873
libraries/net/minecraftforge/forgespi/3.2.0/forgespi-3.2.0.jar|8f1f6942d17d88d704324e8000666a1a|20172
libraries/net/minecraftforge/installertools/1.3.0/installertools-1.3.0.jar|8b8b7d048620ac3f7ffc5d1255b91f60|83178
libraries/net/minecraftforge/jarsplitter/1.1.2/jarsplitter-1.1.2.jar|6336b555885a01ec1b129a0e4074428f|7981
libraries/net/minecraftforge/jarsplitter/1.1.4/jarsplitter-1.1.4.jar|ecb9d6b0438948bef9bc0209aad4e917|7405
libraries/net/minecraftforge/nashorn-core-compat/15.1.1.1/nashorn-core-compat-15.1.1.1.jar|ae37ed8407982eefc9f85fdb1c95a3a0|2194057
libraries/net/minecraftforge/unsafe/0.2.0/unsafe-0.2.0.jar|2d1016ebe4c1a63dd50a59d26bd12db1|2834
libraries/net/minecraftforge/srgutils/0.5.4/srgutils-0.5.4.jar|c1b6ebc2474de52de6d343937fa4d7e6|72075
libraries/net/minecraftforge/srgutils/0.4.11/srgutils-0.4.11.jar|ed43e741ad44c85cac14add5a6ed5793|69289
libraries/net/minecrell/terminalconsoleappender/1.2.0/terminalconsoleappender-1.2.0.jar|679363fa893293791e55a21f81342f87|15977
libraries/net/sf/jopt-simple/jopt-simple/5.0.4/jopt-simple-5.0.4.jar|eb0d9dffe9b0eddead68fe678be76c49|78146
libraries/com/opencsv/opencsv/4.4/opencsv-4.4.jar|0a370fa0055d9d2840599332bd5cbf47|167167
libraries/net/sf/opencsv/opencsv/2.3/opencsv-2.3.jar|9eebabaa007dc329845e5ab3c12b4e6b|19827
libraries/org/antlr/antlr4-runtime/4.9.1/antlr4-runtime-4.9.1.jar|0dcc4b860d5d8d2852ab94d58c56ca2d|337868
libraries/org/apache/logging/log4j/log4j-api/2.17.2/log4j-api-2.17.2.jar|0c39d90e7819c92c111e447bdf786a90|302511
Expand All @@ -54,6 +54,10 @@ libraries/org/ow2/asm/asm-analysis/9.6/asm-analysis-9.6.jar|31c84ef7cc893fb27895
libraries/org/ow2/asm/asm-commons/9.6/asm-commons-9.6.jar|9e317c75534bd1da8c00a67c618ab288|72194
libraries/org/ow2/asm/asm-tree/9.6/asm-tree-9.6.jar|6062608f1a98afe1e853d01fa1221a9e|51935
libraries/org/ow2/asm/asm-util/9.6/asm-util-9.6.jar|bd3bc1c176a787373e9a031073c9574b|91131
libraries/org/ow2/asm/asm/6.1.1/asm-6.1.1.jar|04b72e489b64c54d5776ab59f330bd23|108252
libraries/org/ow2/asm/asm-analysis/6.1.1/asm-analysis-6.1.1.jar|b58c31c1ca0496e6773cc0311f97ceda|31979
libraries/org/ow2/asm/asm-commons/6.1.1/asm-commons-6.1.1.jar|ca6299118bc7b85201671502526bd68b|77745
libraries/org/ow2/asm/asm-tree/6.1.1/asm-tree-6.1.1.jar|d640f7d0efc57192870f73a87f576469|50050
libraries/org/slf4j/slf4j-api/1.8.0-beta4/slf4j-api-1.8.0-beta4.jar|e8147675316a5bc78d1ba5d8cdb9e578|44213
libraries/org/spongepowered/mixin/0.8.4/mixin-0.8.4.jar|2333a4ce6c6969e8c11dfd524112f2c0|993541
libraries/org/xerial/sqlite-jdbc/3.34.0/sqlite-jdbc-3.34.0.jar|743bacfa02e66cad1027e80b065c45ad|7296329
Expand Down

0 comments on commit 32e7242

Please sign in to comment.