fix: serialize metadata extensions
Prism has introduced a few extensions to the meta component version format, which were not exported as JSON in the launcher. This caused the `Customize` button on the version page to not write these new properties to the custom component file. Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
This commit is contained in:
parent
8aae652be1
commit
40970a1a87
@ -306,6 +306,15 @@ void MojangVersionFormat::writeVersionProperties(const VersionFile* in, QJsonObj
|
||||
}
|
||||
out.insert("downloads", downloadsOut);
|
||||
}
|
||||
if(in->compatibleJavaMajors.size())
|
||||
{
|
||||
QJsonArray compatibleJavaMajorsOut;
|
||||
for(auto compatibleJavaMajor : in->compatibleJavaMajors)
|
||||
{
|
||||
compatibleJavaMajorsOut.append(compatibleJavaMajor);
|
||||
}
|
||||
out.insert("compatibleJavaMajors", compatibleJavaMajorsOut);
|
||||
}
|
||||
}
|
||||
|
||||
QJsonDocument MojangVersionFormat::versionFileToJson(const VersionFilePtr &patch)
|
||||
|
@ -331,6 +331,20 @@ QJsonDocument OneSixVersionFormat::versionFileToJson(const VersionFilePtr &patch
|
||||
writeString(root, "appletClass", patch->appletClass);
|
||||
writeStringList(root, "+tweakers", patch->addTweakers);
|
||||
writeStringList(root, "+traits", patch->traits.values());
|
||||
writeStringList(root, "+jvmArgs", patch->addnJvmArguments);
|
||||
if (!patch->agents.isEmpty())
|
||||
{
|
||||
QJsonArray array;
|
||||
for (auto value: patch->agents)
|
||||
{
|
||||
QJsonObject agentOut = OneSixVersionFormat::libraryToJson(value->library().get());
|
||||
if (!value->argument().isEmpty())
|
||||
agentOut.insert("argument", value->argument());
|
||||
|
||||
array.append(agentOut);
|
||||
}
|
||||
root.insert("+agents", array);
|
||||
}
|
||||
if (!patch->libraries.isEmpty())
|
||||
{
|
||||
QJsonArray array;
|
||||
|
Loading…
Reference in New Issue
Block a user