Skip to content

Commit

Permalink
Update to 1.5.3
Browse files Browse the repository at this point in the history
  • Loading branch information
thecatcore committed Feb 6, 2024
1 parent afee67e commit dda7a0b
Show file tree
Hide file tree
Showing 8 changed files with 47 additions and 30 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ plugins {
id "com.github.gmazzo.buildconfig" version "5.2.0"
}

def legacyVersion = "1.7.6"
def legacyVersion = "1.7.7"
group 'net.legacyfabric'
version '1.5.3'

Expand Down
1 change: 1 addition & 0 deletions src/main/java/net/fabricmc/meta/FabricMeta.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
import java.util.concurrent.TimeUnit;

import com.google.gson.stream.JsonReader;
import net.legacyfabric.meta.data.LegacyVersionDatabase;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

Expand Down
3 changes: 2 additions & 1 deletion src/main/java/net/fabricmc/meta/web/ProfileHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
import com.google.gson.JsonObject;
import net.fabricmc.meta.data.VersionDatabase;
import net.legacyfabric.meta.data.LegacyVersionDatabase;
import net.legacyfabric.meta.utils.LegacyReference;
import org.apache.commons.io.IOUtils;

import net.fabricmc.meta.utils.Reference;
Expand Down Expand Up @@ -116,7 +117,7 @@ private static JsonObject buildProfileJson(LoaderInfoV2 info, String side) {
JsonObject librariesObject = launcherMeta.get("libraries").getAsJsonObject();
// Build the libraries array with the existing libs + loader and intermediary
JsonArray libraries = (JsonArray) librariesObject.get("common");
libraries.add(formatLibrary(info.getIntermediary().getMaven(), LegacyVersionDatabase.MAVEN_URL));
libraries.add(formatLibrary(info.getIntermediary().getMaven(), LegacyReference.LEGACY_FABRIC_MAVEN_URL));
libraries.add(formatLibrary(info.getLoader().getMaven(), Reference.FABRIC_MAVEN_URL));

if (librariesObject.has(side)) {
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/net/fabricmc/meta/web/ServerBootstrap.java
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
import io.javalin.http.Context;
import io.javalin.http.Handler;
import io.javalin.http.InternalServerErrorResponse;
import net.legacyfabric.meta.utils.LegacyReference;
import org.apache.commons.io.FileUtils;

import net.fabricmc.meta.FabricMeta;
Expand Down Expand Up @@ -198,7 +199,6 @@ private static int getCacheDuration(Context ctx) {
}

private static String getInstallerURL() {
// Reference.LOCAL_FABRIC_MAVEN_URL+"net/fabricmc/fabric-installer/%1$s/fabric-installer-%1$s-server.jar"
return "https://maven.legacyfabric.net/net/legacyfabric/fabric-installer/%1$s/fabric-installer-%1$s-server.jar";
return LegacyReference.LOCAL_LEGACY_FABRIC_MAVEN_URL + "net/legacyfabric/fabric-installer/%1$s/fabric-installer-%1$s-server.jar";
}
}
20 changes: 0 additions & 20 deletions src/main/java/net/legacyfabric/meta/LegacyConstants.java

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,17 @@
import net.fabricmc.meta.web.models.BaseVersion;
import net.fabricmc.meta.web.models.MavenBuildVersion;
import net.fabricmc.meta.web.models.MavenUrlVersion;
import net.legacyfabric.meta.utils.LegacyReference;
import net.legacyfabric.meta.web.models.LegacyMavenUrlVersion;

import java.util.List;
import java.util.function.Function;
import java.util.stream.Collectors;

public class LegacyVersionDatabase extends VersionDatabase {
public static final String MAVEN_URL = "https://repo.legacyfabric.net/repository/legacyfabric/";

public static final PomParser MAPPINGS_PARSER = new PomParser(MAVEN_URL + "net/legacyfabric/yarn/maven-metadata.xml");
public static final PomParser INTERMEDIARY_PARSER = new PomParser(MAVEN_URL + "net/legacyfabric/intermediary/maven-metadata.xml");
public static final PomParser INSTALLER_PARSER = new PomParser(MAVEN_URL + "net/legacyfabric/fabric-installer/maven-metadata.xml");
public static final PomParser MAPPINGS_PARSER = new PomParser(LegacyReference.LOCAL_LEGACY_FABRIC_MAVEN_URL + "net/legacyfabric/yarn/maven-metadata.xml");
public static final PomParser INTERMEDIARY_PARSER = new PomParser(LegacyReference.LOCAL_LEGACY_FABRIC_MAVEN_URL + "net/legacyfabric/intermediary/maven-metadata.xml");
public static final PomParser INSTALLER_PARSER = new PomParser(LegacyReference.LOCAL_LEGACY_FABRIC_MAVEN_URL + "net/legacyfabric/fabric-installer/maven-metadata.xml");

public PomParser getMappingsParser() {
return MAPPINGS_PARSER;
Expand Down
35 changes: 35 additions & 0 deletions src/main/java/net/legacyfabric/meta/utils/LegacyReference.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
/*
* Copyright (c) 2021-2024 Legacy Fabric
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package net.legacyfabric.meta.utils;

import net.fabricmc.meta.FabricMeta;

public class LegacyReference {
/**
* Legacy Fabric maven url to expose to the user.
*
* <p>This shouldn't be directly accessed by this meta server instance!
*/
public static final String LEGACY_FABRIC_MAVEN_URL = "https://repo.legacyfabric.net/repository/legacyfabric/";

/**
* Legacy Fabric maven url to access from this meta server instance.
*
* <p>This is not to be included in any output data!
*/
public static final String LOCAL_LEGACY_FABRIC_MAVEN_URL = FabricMeta.getConfig().getOrDefault("localLegacyFabricMavenUrl", LEGACY_FABRIC_MAVEN_URL);
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

import net.fabricmc.meta.web.models.MavenUrlVersion;
import net.legacyfabric.meta.data.LegacyVersionDatabase;
import net.legacyfabric.meta.utils.LegacyReference;

public class LegacyMavenUrlVersion extends MavenUrlVersion {
public LegacyMavenUrlVersion(String maven) {
Expand All @@ -26,6 +27,6 @@ public LegacyMavenUrlVersion(String maven) {

@Override
public String getMavenUrl() {
return LegacyVersionDatabase.MAVEN_URL;
return LegacyReference.LEGACY_FABRIC_MAVEN_URL;
}
}

0 comments on commit dda7a0b

Please sign in to comment.