Skip to content

Commit bc45f84

Browse files
committed
feature/bug: Download M-series LWJGL natives
1 parent 5fddfe8 commit bc45f84

File tree

3 files changed

+8
-2
lines changed

3 files changed

+8
-2
lines changed

src/main/java/org/mcphackers/mcp/tools/FileUtil.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,10 +116,9 @@ public static void extract(final Path zipFile, final Path destDir, Function<ZipE
116116
ZipEntry entry;
117117
while ((entry = zipInputStream.getNextEntry()) != null) {
118118
Path toPath = destDir.resolve(entry.getName()).normalize();
119-
Files.deleteIfExists(toPath);
120119
if (match.apply(entry)) {
121120
if (!entry.isDirectory()) {
122-
createDirectories(toPath.getParent());
121+
Files.deleteIfExists(toPath);
123122
Files.copy(zipInputStream, toPath);
124123
} else {
125124
createDirectories(toPath);

src/main/java/org/mcphackers/mcp/tools/OS.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,7 @@ public static OS getOs() {
2929
return os;
3030
}
3131

32+
public static boolean isMSeries() {
33+
return os == osx && System.getProperty("os.arch").equals("aarch64");
34+
}
3235
}

src/main/java/org/mcphackers/mcp/tools/versions/json/DependDownload.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,10 @@ public String getNatives() {
121121
}
122122
break;
123123
case osx:
124+
boolean isARM = OS.isMSeries();
125+
if (isARM && getArtifact("natives-osx-arm64") != null) {
126+
return "natives-osx-arm64";
127+
}
124128
if (getArtifact("natives-osx") != null) {
125129
return "natives-osx";
126130
}

0 commit comments

Comments
 (0)