Use FTB's libraries/ and versions/ folders for non-copied instances
This commit is contained in:
parent
5cf599673d
commit
43881b9cdb
@ -95,6 +95,15 @@ QString OneSixFTBInstance::id() const
|
|||||||
return "FTB/" + BaseInstance::id();
|
return "FTB/" + BaseInstance::id();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QDir OneSixFTBInstance::librariesPath() const
|
||||||
|
{
|
||||||
|
return QDir(MMC->settings()->get("FTBRoot").toString() + "/libraries");
|
||||||
|
}
|
||||||
|
QDir OneSixFTBInstance::versionsPath() const
|
||||||
|
{
|
||||||
|
return QDir(MMC->settings()->get("FTBRoot").toString() + "/versions");
|
||||||
|
}
|
||||||
|
|
||||||
QString OneSixFTBInstance::getStatusbarDescription()
|
QString OneSixFTBInstance::getStatusbarDescription()
|
||||||
{
|
{
|
||||||
return "OneSix FTB: " + intendedVersionId();
|
return "OneSix FTB: " + intendedVersionId();
|
||||||
|
@ -17,6 +17,9 @@ public:
|
|||||||
|
|
||||||
virtual QString id() const;
|
virtual QString id() const;
|
||||||
|
|
||||||
|
virtual QDir librariesPath() const override;
|
||||||
|
virtual QDir versionsPath() const override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
std::shared_ptr<OneSixLibrary> m_forge;
|
std::shared_ptr<OneSixLibrary> m_forge;
|
||||||
};
|
};
|
||||||
|
@ -192,12 +192,10 @@ MinecraftProcess *OneSixInstance::prepareForLaunch(AuthSessionPtr session)
|
|||||||
auto libs = version->getActiveNormalLibs();
|
auto libs = version->getActiveNormalLibs();
|
||||||
for (auto lib : libs)
|
for (auto lib : libs)
|
||||||
{
|
{
|
||||||
QFileInfo fi(QString("libraries/") + lib->storagePath());
|
launchScript += "cp " + librariesPath().absoluteFilePath(lib->storagePath()) + "\n";
|
||||||
launchScript += "cp " + fi.absoluteFilePath() + "\n";
|
|
||||||
}
|
}
|
||||||
QString targetstr = "versions/" + version->id + "/" + version->id + ".jar";
|
QString targetstr = version->id + "/" + version->id + ".jar";
|
||||||
QFileInfo fi(targetstr);
|
launchScript += "cp " + versionsPath().absoluteFilePath(targetstr) + "\n";
|
||||||
launchScript += "cp " + fi.absoluteFilePath() + "\n";
|
|
||||||
}
|
}
|
||||||
launchScript += "mainClass " + version->mainClass + "\n";
|
launchScript += "mainClass " + version->mainClass + "\n";
|
||||||
|
|
||||||
@ -374,6 +372,15 @@ QString OneSixInstance::getStatusbarDescription()
|
|||||||
return descr;
|
return descr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QDir OneSixInstance::librariesPath() const
|
||||||
|
{
|
||||||
|
return QDir::current().absoluteFilePath("libraries");
|
||||||
|
}
|
||||||
|
QDir OneSixInstance::versionsPath() const
|
||||||
|
{
|
||||||
|
return QDir::current().absoluteFilePath("versions");
|
||||||
|
}
|
||||||
|
|
||||||
QString OneSixInstance::loaderModsDir() const
|
QString OneSixInstance::loaderModsDir() const
|
||||||
{
|
{
|
||||||
return PathCombine(minecraftRoot(), "mods");
|
return PathCombine(minecraftRoot(), "mods");
|
||||||
|
@ -68,6 +68,9 @@ public:
|
|||||||
virtual bool menuActionEnabled(QString action_name) const override;
|
virtual bool menuActionEnabled(QString action_name) const override;
|
||||||
virtual QString getStatusbarDescription() override;
|
virtual QString getStatusbarDescription() override;
|
||||||
|
|
||||||
|
virtual QDir librariesPath() const;
|
||||||
|
virtual QDir versionsPath() const;
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void versionReloaded();
|
void versionReloaded();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user