11package org .mcphackers .mcp .tasks ;
22
3- import static org .mcphackers .mcp .MCPPaths .*;
3+ import static org .mcphackers .mcp .MCPPaths .EXC ;
4+ import static org .mcphackers .mcp .MCPPaths .GAMEDIR ;
5+ import static org .mcphackers .mcp .MCPPaths .JARS_DIR ;
6+ import static org .mcphackers .mcp .MCPPaths .JAR_ORIGINAL ;
7+ import static org .mcphackers .mcp .MCPPaths .MAPPINGS ;
8+ import static org .mcphackers .mcp .MCPPaths .MD5_DIR ;
9+ import static org .mcphackers .mcp .MCPPaths .PATCHES ;
10+ import static org .mcphackers .mcp .MCPPaths .PROJECT ;
11+ import static org .mcphackers .mcp .MCPPaths .REMAPPED ;
12+ import static org .mcphackers .mcp .MCPPaths .SOURCE ;
13+ import static org .mcphackers .mcp .MCPPaths .SOURCE_JAR ;
14+ import static org .mcphackers .mcp .MCPPaths .SOURCE_UNPATCHED ;
415
516import java .io .BufferedWriter ;
617import java .io .ByteArrayOutputStream ;
@@ -100,8 +111,11 @@ protected Stage[] setStages() {
100111 }
101112 }
102113 FileUtil .compress (ffOut , MCPPaths .get (mcp , SOURCE_JAR , side ));
103- FileUtil .deletePackages (ffOut , mcp .getOptions ().getStringArrayParameter (TaskParameter .IGNORED_PACKAGES ));
104- FileUtil .copyDirectory (ffOut , srcPath );
114+ Files .createDirectories (srcPath );
115+ if (mcp .getOptions ().getBooleanParameter (TaskParameter .OUTPUT_SRC )) {
116+ FileUtil .deletePackages (ffOut , mcp .getOptions ().getStringArrayParameter (TaskParameter .IGNORED_PACKAGES ));
117+ FileUtil .copyDirectory (ffOut , srcPath );
118+ }
105119 Files .createDirectories (MCPPaths .get (mcp , GAMEDIR , side ));
106120 }),
107121 stage (getLocalizedStage ("recompile" ),
@@ -222,7 +236,6 @@ public static String getLaunchArgs(MCP mcp) {
222236
223237 public static void createProject (MCP mcp , Side side , int sourceVersion ) throws IOException {
224238 Path proj = MCPPaths .get (mcp , PROJECT , side );
225- String natives = MCPPaths .get (mcp , NATIVES ).toAbsolutePath ().toString ();
226239 Version version = mcp .getCurrentVersion ();
227240 String clientArgs = getLaunchArgs (mcp );
228241 Side [] launchSides = side == Side .MERGED ? new Side []{Side .CLIENT , Side .SERVER } : new Side []{side };
@@ -238,7 +251,7 @@ public static void createProject(MCP mcp, Side side, int sourceVersion) throws I
238251 writer .startAttribute ("classpath" );
239252 writer .startAttribute ("classpathentry kind=\" src\" path=\" src\" " );
240253 writer .startAttribute ("attributes" );
241- writer .writeAttribute ("attribute name=\" org.eclipse.jdt.launching.CLASSPATH_ATTR_LIBRARY_PATH_ENTRY\" value=\" " + natives + "\" " );
254+ writer .writeAttribute ("attribute name=\" org.eclipse.jdt.launching.CLASSPATH_ATTR_LIBRARY_PATH_ENTRY\" value=\" " + projectName + "/libraries/natives \" " );
242255 writer .closeAttribute ("attributes" );
243256 writer .closeAttribute ("classpathentry" );
244257 for (DependDownload dependencyDownload : version .libraries ) {
@@ -318,6 +331,7 @@ public static void createProject(MCP mcp, Side side, int sourceVersion) throws I
318331 writer .writeAttribute ("listEntry value=\" 4\" " );
319332 writer .closeAttribute ("listAttribute" );
320333 writer .startAttribute ("listAttribute key=\" org.eclipse.debug.ui.favoriteGroups\" " );
334+ writer .writeAttribute ("listEntry value=\" org.eclipse.debug.ui.launchGroup.run\" " );
321335 writer .writeAttribute ("listEntry value=\" org.eclipse.debug.ui.launchGroup.debug\" " );
322336 writer .closeAttribute ("listAttribute" );
323337 writer .writeAttribute ("booleanAttribute key=\" org.eclipse.jdt.launching.ATTR_ATTR_USE_ARGFILE\" value=\" false\" " );
0 commit comments