From a7ef915ad5be9e69d6fdde84839d390ba208561f Mon Sep 17 00:00:00 2001 From: calmilamsy Date: Fri, 12 Jul 2024 16:53:33 +0100 Subject: [PATCH] Removes Unnecessary Repo Handlers That Actually Break Things (#4) --- src/main/java/babric/BabricRepositoryHandler.java | 6 +++--- src/main/java/babric/Constants.java | 2 +- .../babric/processor/GambacLibraryProcessor.java | 12 +----------- .../babric/processor/LWJGL2LibraryProcessor.java | 10 ---------- 4 files changed, 5 insertions(+), 25 deletions(-) diff --git a/src/main/java/babric/BabricRepositoryHandler.java b/src/main/java/babric/BabricRepositoryHandler.java index c81c211..c3616bb 100644 --- a/src/main/java/babric/BabricRepositoryHandler.java +++ b/src/main/java/babric/BabricRepositoryHandler.java @@ -44,11 +44,11 @@ private void declareRepositories(RepositoryHandler repositories) { repo.setName("Babric"); repo.setUrl(Constants.BABRIC_MAVEN); }); - repositories.maven(repo -> { // No filter, all parts of this repo are used in a project. + repositories.maven(repo -> { repo.setName("Modrinth"); - repo.setUrl(Constants.MODRINTH_MAVEN); + repo.setUrl(Constants.GLASS_MAVEN); repo.content(content -> { - content.includeModule("maven.modrinth", "gambac"); // Allow only gambac, don't let folk rely on this adding MR for them. + content.includeModule("net.danygames2014", "gambac"); // Allow only gambac, don't let folk rely on this adding MR for them. }); }); } diff --git a/src/main/java/babric/Constants.java b/src/main/java/babric/Constants.java index 137fc9c..31db6e7 100644 --- a/src/main/java/babric/Constants.java +++ b/src/main/java/babric/Constants.java @@ -3,5 +3,5 @@ public class Constants { public static final String LEGACYFABRIC_MAVEN = "https://repo.legacyfabric.net/repository/legacyfabric/"; public static final String BABRIC_MAVEN = "https://maven.glass-launcher.net/babric/"; - public static final String MODRINTH_MAVEN = "https://api.modrinth.com/maven/"; + public static final String GLASS_MAVEN = "https://maven.glass-launcher.net/releases/"; } diff --git a/src/main/java/babric/processor/GambacLibraryProcessor.java b/src/main/java/babric/processor/GambacLibraryProcessor.java index 1877215..05eafbb 100644 --- a/src/main/java/babric/processor/GambacLibraryProcessor.java +++ b/src/main/java/babric/processor/GambacLibraryProcessor.java @@ -49,19 +49,9 @@ public Predicate apply(Consumer dependencyConsumer) { if (!applied) { applied = true; - dependencyConsumer.accept(Library.fromMaven("maven.modrinth:gambac:" + VERSION, Library.Target.LOCAL_MOD)); + dependencyConsumer.accept(Library.fromMaven("net.danygames2014:gambac:" + VERSION, Library.Target.LOCAL_MOD)); } return ALLOW_ALL; } - - @Override - public void applyRepositories(RepositoryHandler repositories) { - repositories.exclusiveContent(repository -> { - repository.forRepositories(repositories.findByName("Modrinth")); - repository.filter(filter -> { - filter.includeModule("maven.modrinth", "gambac"); // Allow only gambac, don't let folk rely on this adding MR for them. - }); - }); - } } diff --git a/src/main/java/babric/processor/LWJGL2LibraryProcessor.java b/src/main/java/babric/processor/LWJGL2LibraryProcessor.java index 7289ee2..94e58a3 100644 --- a/src/main/java/babric/processor/LWJGL2LibraryProcessor.java +++ b/src/main/java/babric/processor/LWJGL2LibraryProcessor.java @@ -50,16 +50,6 @@ public Predicate apply(Consumer dependencyConsumer) { }; } - @Override - public void applyRepositories(RepositoryHandler repositories) { - repositories.exclusiveContent(repository -> { - repository.forRepositories(repositories.findByName("Legacy Fabric")); - repository.filter(filter -> { - filter.includeGroup("org.lwjgl.lwjgl"); - }); - }); - } - public static String getNativeClassifier() { switch (Platform.CURRENT.getOperatingSystem()) { case MAC_OS -> {