Skip to content

Commit 68f4151

Browse files
committed
fix: Assets not downloading for Minecraft (thanks @natowb)
1 parent 3d2fca3 commit 68f4151

File tree

3 files changed

+10
-1
lines changed

3 files changed

+10
-1
lines changed

src/main/java/org/mcphackers/mcp/tasks/TaskDecompile.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,14 @@ protected Stage[] setStages() {
9797
FileUtil.deletePackages(ffOut, mcp.getOptions().getStringArrayParameter(TaskParameter.IGNORED_PACKAGES));
9898
FileUtil.copyDirectory(ffOut, srcPath);
9999
}
100+
101+
// Copy asset indexes if client/merged
102+
if (side.includesClient()) {
103+
Path assets = MCPPaths.get(mcp, JARS).resolve("assets");
104+
if (Files.exists(assets)) {
105+
FileUtil.copyDirectory(assets, MCPPaths.get(mcp, GAMEDIR, side).resolve("assets"));
106+
}
107+
}
100108
}), stage(getLocalizedStage("recompile"), 95, () -> new TaskUpdateMD5(side, mcp, this).doTask()),};
101109
}
102110

src/main/java/org/mcphackers/mcp/tasks/TaskRecompile.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ public void recompile(MCP mcp, Side side, String javaHome, Iterable<File> src, I
205205
boolean isWindows = OS.getOs().equals(OS.windows);
206206
Path javac = Paths.get(javaHome).resolve("bin").resolve(isWindows ? "javac.exe" : "javac");
207207
if (!Files.exists(javac)) {
208-
throw new RuntimeException("Failed to find javac in " + javaHome);
208+
throw new RuntimeException("Failed to find javac at " + javac.toAbsolutePath());
209209
}
210210

211211
Path binDir = MCPPaths.get(mcp, BIN, side);

src/main/java/org/mcphackers/mcp/tools/versions/DownloadData.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ public DownloadData(MCP mcp, Path libraries, Path gameDir, Path client, Path ser
6565
}
6666
try {
6767
Path assetIndex = gameDir.resolve("assets/indexes/" + version.assets + ".json");
68+
Files.createDirectories(assetIndex.getParent());
6869
String assetIndexString;
6970
if (!Files.exists(assetIndex) || !version.assetIndex.sha1.equals(Util.getSHA1(assetIndex))) {
7071
assetIndexString = new String(Util.readAllBytes(FileUtil.openURLStream(new URL(version.assetIndex.url))));

0 commit comments

Comments
 (0)