#72: Replace launcher Mojang API with piston-data and use updated version meta api

This commit is contained in:
Epic 2025-01-15 18:53:05 +11:00 committed by md_5
parent f901b6f52a
commit 37ddb93080
No known key found for this signature in database
GPG key ID: E8E901AC7C617C11

View file

@ -383,7 +383,7 @@ public class Builder
{
if ( versionInfo.getServerUrl() != null )
{
download( versionInfo.getServerUrl(), vanillaJar, HashFormat.MD5, versionInfo.getMinecraftHash() );
download( versionInfo.getServerUrl().replace("launcher.mojang", "piston-data.mojang"), vanillaJar, HashFormat.MD5, versionInfo.getMinecraftHash() );
} else
{
download( getServerVanillaUrl( versionInfo.getMinecraftVersion() ), vanillaJar, HashFormat.MD5, versionInfo.getMinecraftHash() );
@ -451,7 +451,7 @@ public class Builder
File mojangMappings = new File( workDir, "minecraft_server." + versionInfo.getMinecraftVersion() + ".txt" );
if ( !mojangMappings.exists() )
{
download( versionInfo.getMappingsUrl(), mojangMappings );
download( versionInfo.getMappingsUrl().replace("launcher.mojang.com", "piston-data.mojang.com"), mojangMappings );
}
MapUtil mapUtil = new MapUtil();
@ -1168,7 +1168,7 @@ public class Builder
{
Gson gson = new Gson();
String responseManifest = get( "https://launchermeta.mojang.com/mc/game/version_manifest.json" );
String responseManifest = get( "https://piston-meta.mojang.com/mc/game/version_manifest_v2.json" );
JsonObject manifest = gson.fromJson( responseManifest, JsonObject.class );
JsonArray manifestVersions = manifest.getAsJsonArray( "versions" );