@@ -5,7 +5,6 @@ import dex.mcgitmaker.data.Artifact
5
5
import dex.mcgitmaker.data.McVersion
6
6
import groovy.json.JsonGenerator
7
7
import groovy.json.JsonOutput
8
- import net.fabricmc.stitch.util.StitchUtil
9
8
import org.jetbrains.java.decompiler.main.Fernflower
10
9
import org.jetbrains.java.decompiler.main.decompiler.DirectoryResultSaver
11
10
import org.jetbrains.java.decompiler.main.decompiler.PrintStreamLogger
@@ -35,12 +34,12 @@ class Decompiler {
35
34
options. put(IFernflowerPreferences . THREADS , Integer . toString(Runtime . getRuntime(). availableProcessors() - 3 ));
36
35
// options.put(IFabricJavadocProvider.PROPERTY_NAME, new QfTinyJavadocProvider(metaData.javaDocs().toFile()));
37
36
38
- // Experimental QF preferences
37
+ // Experimental VF preferences
39
38
options. put(IFernflowerPreferences . PATTERN_MATCHING , " 1" );
40
- options. put(IFernflowerPreferences . EXPERIMENTAL_TRY_LOOP_FIX , " 1" );
39
+ options. put(IFernflowerPreferences . TRY_LOOP_FIX , " 1" );
41
40
// options.putAll(ReflectionUtil.<Map<String, String>>maybeGetFieldOrRecordComponent(metaData, "options").orElse(Map.of()));
42
41
43
- Fernflower ff = new Fernflower (Zips ::getBytes, new DirectoryResultSaver (decompiledPath(mcVersion). toFile()), options, new PrintStreamLogger (/* System.out*/ NULL_IS ))
42
+ Fernflower ff = new Fernflower (new DirectoryResultSaver (decompiledPath(mcVersion). toFile()), options, new PrintStreamLogger (/* System.out*/ NULL_IS ))
44
43
45
44
println ' Adding libraries...'
46
45
for (Artifact library : mcVersion. libraries) {
@@ -72,17 +71,4 @@ class Decompiler {
72
71
x. createNewFile()
73
72
x. write(JsonOutput . prettyPrint(generator. toJson(c)))
74
73
}
75
-
76
- // Adapted from loom-quiltflower by Juuxel
77
- static final class Zips {
78
- static byte [] getBytes (String outerPath , String innerPath ) throws IOException {
79
- if (innerPath == null ) {
80
- return Files . readAllBytes(Path . of(outerPath));
81
- }
82
-
83
- try (StitchUtil.FileSystemDelegate fs = StitchUtil . getJarFileSystem(new File (outerPath), false )) {
84
- return Files . readAllBytes(fs. get(). getPath(innerPath));
85
- }
86
- }
87
- }
88
74
}
0 commit comments