mirror of
https://github.com/PrismLauncher/PrismLauncher.git
synced 2025-06-12 13:17:41 +02:00
Added java metadata
Signed-off-by: Trial97 <alexandru.tripon97@gmail.com>
This commit is contained in:
@ -36,6 +36,8 @@
|
||||
#include "OneSixVersionFormat.h"
|
||||
#include <Json.h>
|
||||
#include <minecraft/MojangVersionFormat.h>
|
||||
#include <QList>
|
||||
#include "java/JavaRuntime.h"
|
||||
#include "minecraft/Agent.h"
|
||||
#include "minecraft/ParseUtils.h"
|
||||
|
||||
@ -255,6 +257,18 @@ VersionFilePtr OneSixVersionFormat::versionFileFromJson(const QJsonDocument& doc
|
||||
out->m_volatile = requireBoolean(root, "volatile");
|
||||
}
|
||||
|
||||
if (root.contains("runtimes")) {
|
||||
auto runtimes = requireObject(root, "runtimes");
|
||||
out->runtimes = {};
|
||||
for (auto key : runtimes.keys()) {
|
||||
QList<JavaRuntime::MetaPtr> list;
|
||||
for (auto runtime : ensureArray(runtimes, key)) {
|
||||
list.append(JavaRuntime::parseJavaMeta(ensureObject(runtime)));
|
||||
}
|
||||
out->runtimes[key] = list;
|
||||
}
|
||||
}
|
||||
|
||||
/* removed features that shouldn't be used */
|
||||
if (root.contains("tweakers")) {
|
||||
out->addProblem(ProblemSeverity::Error, QObject::tr("Version file contains unsupported element 'tweakers'"));
|
||||
|
Reference in New Issue
Block a user