11package org .mcphackers .mcp .tasks ;
22
3- import codechicken .diffpatch .cli .PatchOperation ;
4- import net .fabricmc .tinyremapper .*;
3+ import java .io .IOException ;
4+ import java .nio .file .Files ;
5+ import java .nio .file .Path ;
6+ import java .nio .file .Paths ;
7+ import java .util .function .BiConsumer ;
8+ import java .util .regex .Pattern ;
9+
510import org .mcphackers .mcp .MCPConfig ;
11+ import org .mcphackers .mcp .ProgressInfo ;
612import org .mcphackers .mcp .tasks .info .TaskInfo ;
7- import org .mcphackers .mcp .tools .ProgressInfo ;
8- import org .mcphackers .mcp .tools .Util ;
13+ import org .mcphackers .mcp .tools .FileUtil ;
914import org .mcphackers .mcp .tools .constants .GLConstants ;
1015import org .mcphackers .mcp .tools .constants .MathConstants ;
1116import org .mcphackers .mcp .tools .fernflower .Decompiler ;
1217import org .mcphackers .mcp .tools .mcinjector .MCInjector ;
1318
14- import java . io . IOException ;
15- import java . nio . file . Files ;
16- import java . nio . file . Path ;
17- import java . nio . file . Paths ;
18- import java . util . function . BiConsumer ;
19- import java . util . regex . Pattern ;
19+ import codechicken . diffpatch . cli . PatchOperation ;
20+ import net . fabricmc . tinyremapper . IMappingProvider ;
21+ import net . fabricmc . tinyremapper . NonClassCopyMode ;
22+ import net . fabricmc . tinyremapper . OutputConsumerPath ;
23+ import net . fabricmc . tinyremapper . TinyRemapper ;
24+ import net . fabricmc . tinyremapper . TinyUtils ;
2025
2126public class TaskDecompile extends Task {
2227
@@ -57,15 +62,15 @@ public void doTask() throws Exception {
5762 Path patchesPath = Paths .get (chooseFromSide (MCPConfig .CLIENT_PATCHES , MCPConfig .SERVER_PATCHES ));
5863 Path mappings = Paths .get (chooseFromSide (MCPConfig .CLIENT_MAPPINGS , MCPConfig .SERVER_MAPPINGS ));
5964
60- boolean hasLWJGL = side == 0 ;
65+ boolean hasLWJGL = side == CLIENT ;
6166
6267 if (Files .exists (srcPath )) {
6368 throw new IOException (chooseFromSide ("Client" , "Server" ) + " sources found! Aborting." );
6469 }
6570 for (Path path : new Path [] { Paths .get (tinyOut ), Paths .get (excOut ), Paths .get (srcZip )}) {
6671 Files .deleteIfExists (path );
6772 }
68- Util .deleteDirectoryIfExists (ffOut );
73+ FileUtil .deleteDirectoryIfExists (ffOut );
6974 while (step < STEPS ) {
7075 step ();
7176 switch (step ) {
@@ -93,8 +98,8 @@ public void doTask() throws Exception {
9398 this .decompiler .decompile (excOut , srcZip , chooseFromSide (MCPConfig .JAVADOC_CLIENT , MCPConfig .JAVADOC_SERVER ));
9499 break ;
95100 case EXTRACT :
96- Util .createDirectories (Paths .get (MCPConfig .SRC ));
97- Util .unzipByExtension (Paths .get (srcZip ), ffOut , ".java" );
101+ FileUtil .createDirectories (Paths .get (MCPConfig .SRC ));
102+ FileUtil .unzipByExtension (Paths .get (srcZip ), ffOut , ".java" );
98103 break ;
99104 case PATCH :
100105 if (MCPConfig .patch && Files .exists (patchesPath )) {
@@ -111,13 +116,13 @@ public void doTask() throws Exception {
111116 }
112117 break ;
113118 case CONSTS :
114- new MathConstants ().replace (ffOut );
115119 if (hasLWJGL ) {
116120 new GLConstants ().replace (ffOut );
117121 }
122+ new MathConstants ().replace (ffOut );
118123 break ;
119124 case COPYSRC :
120- Util .copyDirectory (ffOut , srcPath , MCPConfig .ignorePackages );
125+ FileUtil .copyDirectory (ffOut , srcPath , MCPConfig .ignorePackages );
121126 break ;
122127 case RECOMPILE :
123128 recompTask .doTask ();
0 commit comments