mirror of
https://github.com/PrismLauncher/PrismLauncher.git
synced 2026-06-30 02:20:00 +03:00
GH-2026 implement changes necessary to support 1.13 snapshots
This commit is contained in:
parent
17c8f31a09
commit
85ae710d40
51 changed files with 2632 additions and 1058 deletions
|
|
@ -192,6 +192,19 @@ VersionFilePtr OneSixVersionFormat::versionFileFromJson(const QJsonDocument &doc
|
|||
out->mainJar = lib;
|
||||
}
|
||||
|
||||
if (root.contains("requires"))
|
||||
{
|
||||
Meta::parseRequires(root, &out->requires);
|
||||
}
|
||||
if (root.contains("conflicts"))
|
||||
{
|
||||
Meta::parseRequires(root, &out->conflicts);
|
||||
}
|
||||
if (root.contains("volatile"))
|
||||
{
|
||||
out->m_volatile = requireBoolean(root, "volatile");
|
||||
}
|
||||
|
||||
/* removed features that shouldn't be used */
|
||||
if (root.contains("tweakers"))
|
||||
{
|
||||
|
|
@ -216,13 +229,9 @@ VersionFilePtr OneSixVersionFormat::versionFileFromJson(const QJsonDocument &doc
|
|||
return out;
|
||||
}
|
||||
|
||||
QJsonDocument OneSixVersionFormat::versionFileToJson(const VersionFilePtr &patch, bool saveOrder)
|
||||
QJsonDocument OneSixVersionFormat::versionFileToJson(const VersionFilePtr &patch)
|
||||
{
|
||||
QJsonObject root;
|
||||
if (saveOrder)
|
||||
{
|
||||
root.insert("order", patch->order);
|
||||
}
|
||||
writeString(root, "name", patch->name);
|
||||
|
||||
writeString(root, "uid", patch->uid);
|
||||
|
|
@ -266,6 +275,18 @@ QJsonDocument OneSixVersionFormat::versionFileToJson(const VersionFilePtr &patch
|
|||
}
|
||||
root.insert("mods", array);
|
||||
}
|
||||
if(!patch->requires.empty())
|
||||
{
|
||||
Meta::serializeRequires(root, &patch->requires, "requires");
|
||||
}
|
||||
if(!patch->conflicts.empty())
|
||||
{
|
||||
Meta::serializeRequires(root, &patch->conflicts, "conflicts");
|
||||
}
|
||||
if(patch->m_volatile)
|
||||
{
|
||||
root.insert("volatile", true);
|
||||
}
|
||||
// write the contents to a json document.
|
||||
{
|
||||
QJsonDocument out;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue