summaryrefslogtreecommitdiffstats
path: root/api/logic/minecraft/ftb/FTBProfileStrategy.cpp
diff options
context:
space:
mode:
authorPetr Mrázek <peterix@gmail.com>2017-07-23 19:20:21 +0200
committerPetr Mrázek <peterix@gmail.com>2017-09-09 18:29:52 +0200
commit4c01983f470e25dfd4c997201370057bba64832e (patch)
tree351483b733f39c11c9f57eef7b1c2e6be24428b6 /api/logic/minecraft/ftb/FTBProfileStrategy.cpp
parent3fb4ce713fb7fdef2753009967fa58103fa69974 (diff)
downloadMultiMC-4c01983f470e25dfd4c997201370057bba64832e.tar
MultiMC-4c01983f470e25dfd4c997201370057bba64832e.tar.gz
MultiMC-4c01983f470e25dfd4c997201370057bba64832e.tar.lz
MultiMC-4c01983f470e25dfd4c997201370057bba64832e.tar.xz
MultiMC-4c01983f470e25dfd4c997201370057bba64832e.zip
NOISSUE remove FTB integration
Diffstat (limited to 'api/logic/minecraft/ftb/FTBProfileStrategy.cpp')
-rw-r--r--api/logic/minecraft/ftb/FTBProfileStrategy.cpp134
1 files changed, 0 insertions, 134 deletions
diff --git a/api/logic/minecraft/ftb/FTBProfileStrategy.cpp b/api/logic/minecraft/ftb/FTBProfileStrategy.cpp
deleted file mode 100644
index d5df7848..00000000
--- a/api/logic/minecraft/ftb/FTBProfileStrategy.cpp
+++ /dev/null
@@ -1,134 +0,0 @@
-#include "FTBProfileStrategy.h"
-#include "OneSixFTBInstance.h"
-
-#include <FileSystem.h>
-
-#include <QDir>
-#include <QUuid>
-#include <QJsonDocument>
-#include <QJsonArray>
-
-FTBProfileStrategy::FTBProfileStrategy(OneSixFTBInstance* instance) : OneSixProfileStrategy(instance)
-{
-}
-
-void FTBProfileStrategy::loadDefaultBuiltinPatches()
-{
- // FIXME: this should be here, but it needs us to be able to deal with multiple libraries paths
- // OneSixProfileStrategy::loadDefaultBuiltinPatches();
- auto mcVersion = m_instance->intendedVersionId();
- auto nativeInstance = dynamic_cast<OneSixFTBInstance *>(m_instance);
-
- ProfilePatchPtr minecraftPatch;
- {
- std::shared_ptr< VersionFile > file;
- auto mcJson = m_instance->versionsPath().absoluteFilePath(mcVersion + "/" + mcVersion + ".json");
- // load up the base minecraft patch
- if(QFile::exists(mcJson))
- {
- file = ProfileUtils::parseJsonFile(QFileInfo(mcJson), false);
- for(auto addLib: file->libraries)
- {
- addLib->setHint("local");
- addLib->setStoragePrefix(nativeInstance->librariesPath().absolutePath());
- }
- }
- else
- {
- file = std::make_shared<VersionFile>();
- file->addProblem(ProblemSeverity::Error, QObject::tr("Minecraft version is missing in the FTB data."));
- }
- file->uid = "net.minecraft";
- file->name = QObject::tr("Minecraft (tracked)");
- if(file->version.isEmpty())
- {
- file->version = mcVersion;
- }
- minecraftPatch = std::make_shared<ProfilePatch>(file);
- minecraftPatch->setVanilla(true);
- minecraftPatch->setOrder(-2);
- }
- profile->appendPatch(minecraftPatch);
-
- ProfilePatchPtr packPatch;
- {
- std::shared_ptr< VersionFile > file;
- auto mcJson = m_instance->minecraftRoot() + "/pack.json";
- // load up the base minecraft patch, if it's there...
- if(QFile::exists(mcJson))
- {
- file = ProfileUtils::parseJsonFile(QFileInfo(mcJson), false);
- // adapt the loaded file - the FTB patch file format is different than ours.
- file->minecraftVersion.clear();
- file->mainJar = nullptr;
- for(auto addLib: file->libraries)
- {
- addLib->setHint("local");
- addLib->setStoragePrefix(nativeInstance->librariesPath().absolutePath());
- }
- }
- else
- {
- file = std::make_shared<VersionFile>();
- file->addProblem(ProblemSeverity::Error, QObject::tr("Modpack version file is missing."));
- }
- file->uid = "org.multimc.ftb.pack";
- file->name = QObject::tr("%1 (FTB pack)").arg(m_instance->name());
- if(file->version.isEmpty())
- {
- file->version = QObject::tr("Unknown");
- QFile versionFile (FS::PathCombine(m_instance->instanceRoot(), "version"));
- if(versionFile.exists())
- {
- if(versionFile.open(QIODevice::ReadOnly))
- {
- // FIXME: just guessing the encoding/charset here.
- auto version = QString::fromUtf8(versionFile.readAll());
- file->version = version;
- }
- }
- }
- packPatch = std::make_shared<ProfilePatch>(file);
- packPatch->setVanilla(true);
- packPatch->setOrder(1);
- }
- profile->appendPatch(packPatch);
-}
-
-void FTBProfileStrategy::load()
-{
- profile->clearPatches();
-
- loadDefaultBuiltinPatches();
- loadUserPatches();
-}
-
-bool FTBProfileStrategy::saveOrder(ProfileUtils::PatchOrder order)
-{
- return false;
-}
-
-bool FTBProfileStrategy::resetOrder()
-{
- return false;
-}
-
-bool FTBProfileStrategy::installJarMods(QStringList filepaths)
-{
- return false;
-}
-
-bool FTBProfileStrategy::installCustomJar(QString filepath)
-{
- return false;
-}
-
-bool FTBProfileStrategy::customizePatch(ProfilePatchPtr patch)
-{
- return false;
-}
-
-bool FTBProfileStrategy::revertPatch(ProfilePatchPtr patch)
-{
- return false;
-}