Skip to content

Commit bf61f2e

Browse files
committed
Stupid hacky OSX maven order fix for lwjgl library.
1 parent e0df47d commit bf61f2e

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

src/userdev/java/net/minecraftforge/gradle/userdev/UserDevPlugin.java

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -245,8 +245,18 @@ public void apply(@Nonnull Project project) {
245245
throw new IllegalStateException("Missing '" + minecraft.getName() + "' dependency.");
246246
}
247247

248-
if (EnvironmentChecks.AUTOMATIC_ATTACH_REPOS.isEnabled())
248+
// this is fucking annoing, for some reason gradle is exploding when any repo returns 404 for org/lwjgl/lwjgl-freetype/3.3.3/lwjgl-freetype-3.3.3-natives-macos-patch.jar
249+
// So move mojang's maven above everything else, which *usually* causes errors because Mojang returns forbidden errors instead of 404s.
250+
// But apparently this fixes osx
251+
boolean isOsx = VersionJson.OS.getCurrent() == VersionJson.OS.OSX;
252+
253+
if (EnvironmentChecks.AUTOMATIC_ATTACH_REPOS.isEnabled()) {
254+
if (isOsx) {
255+
project.getRepositories().maven(Utils.mojangMaven());
256+
project.getRepositories().mavenCentral(Utils.filterForge()); //Needed for MCP Deps; we do not publish any artifacts to maven central
257+
}
249258
project.getRepositories().maven(Utils.forgeMaven());
259+
}
250260

251261
remapper.attachMappings(extension.getMappings().get());
252262

@@ -261,7 +271,7 @@ public void apply(@Nonnull Project project) {
261271
.add(MinecraftRepo.create(project)) //Provides vanilla extra/slim/data jars. These don't care about OBF names.
262272
.attach(project);
263273

264-
if (EnvironmentChecks.AUTOMATIC_ATTACH_REPOS.isEnabled()) {
274+
if (EnvironmentChecks.AUTOMATIC_ATTACH_REPOS.isEnabled() && !isOsx) {
265275
project.getRepositories().maven(Utils.mojangMaven());
266276
project.getRepositories().mavenCentral(Utils.filterForge()); //Needed for MCP Deps; we do not publish any artifacts to maven central
267277
}

0 commit comments

Comments
 (0)