mirror of
https://github.com/AngelAuraMC/Amethyst-Android.git
synced 2025-09-15 15:48:26 -04:00
Refactor[modDetail]: Move mc version auto addition to model constructor
This commit is contained in:
parent
ce5ed86515
commit
23b02cca4c
@ -77,9 +77,6 @@ public class ModrinthApi implements ModpackApi{
|
||||
names[i] = version.get("name").getAsString();
|
||||
mcNames[i] = version.get("game_versions").getAsJsonArray().get(0).getAsString();
|
||||
urls[i] = version.get("files").getAsJsonArray().get(0).getAsJsonObject().get("url").getAsString();
|
||||
|
||||
if (!names[i].contains(mcNames[i]))
|
||||
names[i] += " - " + mcNames[i];
|
||||
}
|
||||
|
||||
return new ModDetail(item, names, mcNames, urls);
|
||||
|
@ -15,6 +15,12 @@ public class ModDetail extends ModItem {
|
||||
this.versionNames = versionNames;
|
||||
this.mcVersionNames = mcVersionNames;
|
||||
this.versionUrls = versionUrls;
|
||||
|
||||
// Add the mc version to the version model
|
||||
for (int i=0; i<versionNames.length; i++){
|
||||
if (!versionNames[i].contains(mcVersionNames[i]))
|
||||
versionNames[i] += " - " + mcVersionNames[i];
|
||||
}
|
||||
}
|
||||
|
||||
@NonNull
|
||||
|
Loading…
x
Reference in New Issue
Block a user