mirror of
https://github.com/PrismLauncher/PrismLauncher.git
synced 2026-06-29 01:54:20 +03:00
fix: don't count JAR mods when checking offline libraries
Signed-off-by: Octol1ttle <l1ttleofficial@outlook.com>
This commit is contained in:
parent
194b72f180
commit
ec4484282c
3 changed files with 23 additions and 10 deletions
|
|
@ -349,7 +349,8 @@ void LaunchProfile::getLibraryFiles(const RuntimeContext& runtimeContext,
|
|||
QStringList& jars,
|
||||
QStringList& nativeJars,
|
||||
const QString& overridePath,
|
||||
const QString& tempPath) const
|
||||
const QString& tempPath,
|
||||
bool addJarMods) const
|
||||
{
|
||||
QStringList native32, native64;
|
||||
jars.clear();
|
||||
|
|
@ -360,7 +361,7 @@ void LaunchProfile::getLibraryFiles(const RuntimeContext& runtimeContext,
|
|||
// NOTE: order is important here, add main jar last to the lists
|
||||
if (m_mainJar) {
|
||||
// FIXME: HACK!! jar modding is weird and unsystematic!
|
||||
if (m_jarMods.size()) {
|
||||
if (m_jarMods.size() && addJarMods) {
|
||||
QDir tempDir(tempPath);
|
||||
jars.append(tempDir.absoluteFilePath("minecraft.jar"));
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -87,7 +87,8 @@ class LaunchProfile : public ProblemProvider {
|
|||
QStringList& jars,
|
||||
QStringList& nativeJars,
|
||||
const QString& overridePath,
|
||||
const QString& tempPath) const;
|
||||
const QString& tempPath,
|
||||
bool addJarMods = true) const;
|
||||
bool hasTrait(const QString& trait) const;
|
||||
ProblemSeverity getProblemSeverity() const override;
|
||||
const QList<PatchProblem> getProblems() const override;
|
||||
|
|
|
|||
|
|
@ -27,16 +27,27 @@ void EnsureOfflineLibraries::executeTask()
|
|||
{
|
||||
const auto profile = m_instance->getPackProfile()->getProfile();
|
||||
QStringList allJars;
|
||||
profile->getLibraryFiles(m_instance->runtimeContext(), allJars, allJars, m_instance->getLocalLibraryPath(), m_instance->binRoot());
|
||||
profile->getLibraryFiles(m_instance->runtimeContext(), allJars, allJars, m_instance->getLocalLibraryPath(), m_instance->binRoot(),
|
||||
false);
|
||||
|
||||
QStringList missing;
|
||||
for (const auto& jar : allJars) {
|
||||
if (!QFileInfo::exists(jar)) {
|
||||
emit logLine(tr("This instance cannot be launched because some libraries are missing or have not been downloaded yet. Please "
|
||||
"try again in online mode with a working Internet connection"),
|
||||
MessageLevel::Fatal);
|
||||
emitFailed("Required libraries are missing");
|
||||
return;
|
||||
missing.append(jar);
|
||||
}
|
||||
}
|
||||
|
||||
if (missing.isEmpty()) {
|
||||
emitSucceeded();
|
||||
return;
|
||||
}
|
||||
|
||||
emit logLine("Missing libraries:", MessageLevel::Error);
|
||||
for (const auto& jar : missing) {
|
||||
emit logLine(" " + jar, MessageLevel::Error);
|
||||
}
|
||||
emit logLine(tr("\nThis instance cannot be launched because some libraries are missing or have not been downloaded yet. Please "
|
||||
"try again in online mode with a working Internet connection"),
|
||||
MessageLevel::Fatal);
|
||||
emitFailed("Required libraries are missing");
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue