From ccc45765d9881747b2c922be7a13c453c32ce9ed Mon Sep 17 00:00:00 2001 From: zml Date: Sun, 16 Jun 2024 22:31:17 -0700 Subject: [PATCH] fix: forcibly retrieve lwjgl from libraries.minecraft.net Mojang has a patched version that is not on Central. This change does not apply to users who do not inject repositories. --- .../gradle/vanilla/internal/Constants.java | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/subprojects/gradle-plugin/src/main/java/org/spongepowered/gradle/vanilla/internal/Constants.java b/subprojects/gradle-plugin/src/main/java/org/spongepowered/gradle/vanilla/internal/Constants.java index 4105448..542ecba 100644 --- a/subprojects/gradle-plugin/src/main/java/org/spongepowered/gradle/vanilla/internal/Constants.java +++ b/subprojects/gradle-plugin/src/main/java/org/spongepowered/gradle/vanilla/internal/Constants.java @@ -25,6 +25,7 @@ package org.spongepowered.gradle.vanilla.internal; import org.gradle.api.artifacts.dsl.RepositoryHandler; +import org.gradle.api.artifacts.repositories.MavenArtifactRepository; import org.gradle.api.artifacts.repositories.MavenRepositoryContentDescriptor; import org.gradle.util.GradleVersion; import org.objectweb.asm.Opcodes; @@ -121,11 +122,19 @@ private Repositories() { } public static void applyTo(final RepositoryHandler repositories) { - repositories.maven(repo -> { + final MavenArtifactRepository mojang = repositories.maven(repo -> { repo.setUrl(Constants.Repositories.MINECRAFT); repo.mavenContent(MavenRepositoryContentDescriptor::releasesOnly); + repo.metadataSources(MavenArtifactRepository.MetadataSources::mavenPom); // mojang's repo doesn't include GMM repo.setName("minecraft"); }); + repositories.exclusiveContent(exc -> { + exc.forRepositories(mojang) + .filter(conf -> { + conf.includeGroupAndSubgroups("org.lwjgl"); + conf.includeGroupAndSubgroups("com.mojang"); + }); + }); repositories.maven(repo -> { repo.setUrl(Constants.Repositories.MINECRAFT_FORGE); repo.setName("forge");