|
1 | 1 | package org.mcphackers.mcp.tasks; |
2 | 2 |
|
| 3 | +import static org.mcphackers.mcp.MCPPaths.*; |
| 4 | + |
| 5 | +import java.io.IOException; |
| 6 | +import java.nio.file.Files; |
| 7 | +import java.nio.file.Path; |
| 8 | + |
3 | 9 | import org.mcphackers.mcp.MCP; |
4 | 10 | import org.mcphackers.mcp.MCPPaths; |
5 | 11 | import org.mcphackers.mcp.tasks.mode.TaskParameter; |
|
10 | 16 | import org.mcphackers.mcp.tools.mappings.MappingUtil; |
11 | 17 | import org.mcphackers.mcp.tools.project.EclipseProjectWriter; |
12 | 18 | import org.mcphackers.mcp.tools.project.IdeaProjectWriter; |
| 19 | +import org.mcphackers.mcp.tools.project.VSCProjectWriter; |
13 | 20 | import org.mcphackers.mcp.tools.source.Source; |
14 | 21 | import org.mcphackers.rdi.injector.data.ClassStorage; |
15 | 22 | import org.mcphackers.rdi.injector.data.Mappings; |
|
19 | 26 | import org.mcphackers.rdi.nio.RDInjector; |
20 | 27 | import org.objectweb.asm.tree.ClassNode; |
21 | 28 |
|
22 | | -import java.io.IOException; |
23 | | -import java.nio.file.Files; |
24 | | -import java.nio.file.Path; |
25 | | - |
26 | | -import static org.mcphackers.mcp.MCPPaths.*; |
27 | | - |
28 | 29 | public class TaskDecompile extends TaskStaged { |
29 | 30 | public static final int STAGE_DECOMPILE = 2; |
30 | 31 | public static final int STAGE_MD5 = 5; |
@@ -70,10 +71,14 @@ protected Stage[] setStages() { |
70 | 71 | for (ClassNode node : storage) { |
71 | 72 | classVersion = Math.max(classVersion, node.version); |
72 | 73 | } |
| 74 | + // Force Java 8 or later in order to support VSC |
| 75 | + // Java extension does not allow compiling under Java 8 |
| 76 | + classVersion = Math.max(8, classVersion); |
73 | 77 | }), stage(getLocalizedStage("decompile"), () -> { |
74 | 78 | new Decompiler(this, rdiOut, ffOut, mcp.getLibraries(), mcp).decompile(); |
75 | 79 | new EclipseProjectWriter().createProject(mcp, side, ClassUtils.getSourceFromClassVersion(classVersion)); |
76 | 80 | new IdeaProjectWriter().createProject(mcp, side, ClassUtils.getSourceFromClassVersion(classVersion)); |
| 81 | + new VSCProjectWriter().createProject(mcp, side, ClassUtils.getSourceFromClassVersion(classVersion)); |
77 | 82 | }), stage(getLocalizedStage("patch"), 88, () -> { |
78 | 83 | if (mcp.getOptions().getBooleanParameter(TaskParameter.PATCHES) && Files.exists(patchesPath)) { |
79 | 84 | TaskApplyPatch.patch(this, ffOut, ffOut, patchesPath); |
|
0 commit comments