feat: support NeoForge mrpack modpacks
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
This commit is contained in:
parent
52e5ee7111
commit
01c3750835
@ -211,6 +211,8 @@ bool ModrinthCreationTask::createInstance()
|
||||
components->setComponentVersion("org.quiltmc.quilt-loader", m_quilt_version);
|
||||
if (!m_forge_version.isEmpty())
|
||||
components->setComponentVersion("net.minecraftforge", m_forge_version);
|
||||
if (!m_neoForge_version.isEmpty())
|
||||
components->setComponentVersion("net.neoforged", m_neoForge_version);
|
||||
|
||||
if (m_instIcon != "default") {
|
||||
instance.setIconKey(m_instIcon);
|
||||
@ -398,6 +400,8 @@ bool ModrinthCreationTask::parseManifest(const QString& index_path,
|
||||
m_quilt_version = Json::requireString(*it, "Quilt Loader version");
|
||||
} else if (name == "forge") {
|
||||
m_forge_version = Json::requireString(*it, "Forge version");
|
||||
} else if (name == "neoforge") {
|
||||
m_neoForge_version = Json::requireString(*it, "NeoForge version");
|
||||
} else {
|
||||
throw JSONValidationError("Unknown dependency type: " + name);
|
||||
}
|
||||
|
@ -39,7 +39,7 @@ class ModrinthCreationTask final : public InstanceCreationTask {
|
||||
private:
|
||||
QWidget* m_parent = nullptr;
|
||||
|
||||
QString m_minecraft_version, m_fabric_version, m_quilt_version, m_forge_version;
|
||||
QString m_minecraft_version, m_fabric_version, m_quilt_version, m_forge_version, m_neoForge_version;
|
||||
QString m_managed_id, m_managed_version_id, m_managed_name;
|
||||
|
||||
std::vector<Modrinth::File> m_files;
|
||||
|
@ -245,6 +245,7 @@ QByteArray ModrinthPackExportTask::generateIndex()
|
||||
const ComponentPtr quilt = profile->getComponent("org.quiltmc.quilt-loader");
|
||||
const ComponentPtr fabric = profile->getComponent("net.fabricmc.fabric-loader");
|
||||
const ComponentPtr forge = profile->getComponent("net.minecraftforge");
|
||||
const ComponentPtr neoForge = profile->getComponent("net.neoforged");
|
||||
|
||||
// convert all available components to mrpack dependencies
|
||||
QJsonObject dependencies;
|
||||
@ -256,6 +257,8 @@ QByteArray ModrinthPackExportTask::generateIndex()
|
||||
dependencies["fabric-loader"] = fabric->m_version;
|
||||
if (forge != nullptr)
|
||||
dependencies["forge"] = forge->m_version;
|
||||
if (neoForge != nullptr)
|
||||
dependencies["neoforge"] = neoForge->m_version;
|
||||
|
||||
out["dependencies"] = dependencies;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user