Skip to content

Commit

Permalink
Uh oop, didn't commit this.
Browse files Browse the repository at this point in the history
  • Loading branch information
mclegoman authored and thecatcore committed Nov 7, 2023
1 parent 904a684 commit b2b5bf5
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/main/java/net/fabricmc/installer/util/FabricService.java
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,11 @@ public static Json queryMetaJson(String path) throws IOException {
* Query and decode JSON from url, substituting Fabric Maven with fallbacks or overrides.
*/
public static Json queryJsonSubstitutedMaven(String url) throws IOException {
if (!url.startsWith(Reference.DEFAULT_MAVEN_SERVER)) {
if (!url.startsWith(Reference.LEGACY_FABRIC_MAVEN)) {
return Json.read(Utils.readString(new URL(url)));
}

String path = url.substring(Reference.DEFAULT_MAVEN_SERVER.length());
String path = url.substring(Reference.LEGACY_FABRIC_MAVEN.length());

return invokeWithFallbacks((service, arg) -> Json.read(Utils.readString(new URL(service.maven + arg))), path);
}
Expand All @@ -53,12 +53,12 @@ public static Json queryJsonSubstitutedMaven(String url) throws IOException {
* Download url to file, substituting Fabric Maven with fallbacks or overrides.
*/
public static void downloadSubstitutedMaven(String url, Path out) throws IOException {
if (!url.startsWith(Reference.DEFAULT_MAVEN_SERVER)) {
if (!url.startsWith(Reference.LEGACY_FABRIC_MAVEN)) {
Utils.downloadFile(new URL(url), out);
return;
}

String path = url.substring(Reference.DEFAULT_MAVEN_SERVER.length());
String path = url.substring(Reference.LEGACY_FABRIC_MAVEN.length());

invokeWithFallbacks((service, arg) -> {
Utils.downloadFile(new URL(service.maven + arg), out);
Expand Down Expand Up @@ -106,8 +106,8 @@ private interface Handler<A, R> {
public static void setFixed(String metaUrl, String mavenUrl) {
if (metaUrl == null && mavenUrl == null) throw new NullPointerException("both meta and maven are null");

if (metaUrl == null) metaUrl = Reference.DEFAULT_META_SERVER;
if (mavenUrl == null) mavenUrl = Reference.DEFAULT_MAVEN_SERVER;
if (metaUrl == null) metaUrl = Reference.LEGACY_FABRIC_META;
if (mavenUrl == null) mavenUrl = Reference.LEGACY_FABRIC_MAVEN;

activeIndex = -1;
fixedService = new FabricService(metaUrl, mavenUrl);
Expand Down

0 comments on commit b2b5bf5

Please sign in to comment.