Skip to content

Commit

Permalink
update getAssetIndex() (#726)
Browse files Browse the repository at this point in the history
* update

* fix
  • Loading branch information
zkitefly authored Dec 31, 2024
1 parent 488568c commit 2801457
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 2 deletions.
37 changes: 36 additions & 1 deletion FCLCore/src/main/java/com/tungsten/fclcore/game/Version.java
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,42 @@ public DownloadInfo getDownloadInfo() {

public AssetIndexInfo getAssetIndex() {
String assetsId = assets == null ? "legacy" : assets;
return assetIndex == null ? new AssetIndexInfo(assetsId, Constants.DEFAULT_INDEX_URL + assetsId + ".json") : assetIndex;

if (assetIndex == null) {
String hash;
switch (assetsId) {
case "1.8":
hash = "f6ad102bcaa53b1a58358f16e376d548d44933ec";
break;
case "14w31a":
hash = "10a2a0e75b03cfb5a7196abbdf43b54f7fa61deb";
break;
case "14w25a":
hash = "32ff354a3be1c4dd83027111e6d79ee4d701d2c0";
break;
case "1.7.4":
hash = "545510a60f526b9aa8a38f9c0bc7a74235d21675";
break;
case "1.7.10":
hash = "1863782e33ce7b584fc45b037325a1964e095d3e";
break;
case "1.7.3":
hash = "f6cf726f4747128d13887010c2cbc44ba83504d9";
break;
case "pre-1.6":
hash = "3d8e55480977e32acd9844e545177e69a52f594b";
break;
case "legacy":
default:
assetsId = "legacy";
hash = "770572e819335b6c0a053f8378ad88eda189fc14";
}

String url = Constants.DEFAULT_INDEX_URL + hash + "/" + assetsId + ".json";
return new AssetIndexInfo(assetsId, url);
} else {
return assetIndex;
}
}

public boolean appliesToCurrentEnvironment() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@ public class Constants {

public static final String DEFAULT_LIBRARY_URL = "https://libraries.minecraft.net/";
public static final String DEFAULT_VERSION_DOWNLOAD_URL = "https://bmclapi2.bangbang93.com/versions/";
public static final String DEFAULT_INDEX_URL = "https://launchermeta.mojang.com/mc-staging/assets/legacy/c0fd82e8ce9fbc93119e40d96d5a4e62cfa3f729/";
public static final String DEFAULT_INDEX_URL = "https://launchermeta.mojang.com/v1/packages/";

}

0 comments on commit 2801457

Please sign in to comment.