Skip to content

Commit

Permalink
fix: forcibly retrieve lwjgl from libraries.minecraft.net
Browse files Browse the repository at this point in the history
Mojang has a patched version that is not on Central.
This change does not apply to users who do not inject repositories.
  • Loading branch information
zml2008 committed Jun 17, 2024
1 parent 0cfde2e commit ccc4576
Showing 1 changed file with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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");
Expand Down

0 comments on commit ccc4576

Please sign in to comment.