mirror of
https://github.com/UltimMC/Launcher.git
synced 2025-10-03 16:51:30 +00:00
WIP remove jank previously added for a minimal forge hack
This commit is contained in:
@@ -45,10 +45,6 @@ void Library::getApplicableFiles(
|
|||||||
native += actualPath(raw_storage);
|
native += actualPath(raw_storage);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (!presenceOnly)
|
|
||||||
{
|
|
||||||
jar += actualPath(raw_storage);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
QList< std::shared_ptr< NetAction > > Library::getDownloads(
|
QList< std::shared_ptr< NetAction > > Library::getDownloads(
|
||||||
@@ -61,7 +57,6 @@ QList< std::shared_ptr< NetAction > > Library::getDownloads(
|
|||||||
QList<NetActionPtr> out;
|
QList<NetActionPtr> out;
|
||||||
bool stale = isAlwaysStale();
|
bool stale = isAlwaysStale();
|
||||||
bool instanceLocal = isInstanceLocal();
|
bool instanceLocal = isInstanceLocal();
|
||||||
bool launcherLocal = isLocalBuilt();
|
|
||||||
|
|
||||||
auto check_instance_local_file = [&](QString storage)
|
auto check_instance_local_file = [&](QString storage)
|
||||||
{
|
{
|
||||||
@@ -77,27 +72,12 @@ QList< std::shared_ptr< NetAction > > Library::getDownloads(
|
|||||||
return true;
|
return true;
|
||||||
};
|
};
|
||||||
|
|
||||||
auto check_launcher_local_file = [&](QString storage)
|
|
||||||
{
|
|
||||||
QFileInfo localFileInfo("libraries/" + storage);
|
|
||||||
if(!localFileInfo.exists())
|
|
||||||
{
|
|
||||||
failedLocalFiles.append(localFileInfo.filePath());
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
};
|
|
||||||
|
|
||||||
auto add_download = [&](QString storage, QString url, QString sha1)
|
auto add_download = [&](QString storage, QString url, QString sha1)
|
||||||
{
|
{
|
||||||
if(instanceLocal)
|
if(instanceLocal)
|
||||||
{
|
{
|
||||||
return check_instance_local_file(storage);
|
return check_instance_local_file(storage);
|
||||||
}
|
}
|
||||||
else if(launcherLocal)
|
|
||||||
{
|
|
||||||
return check_launcher_local_file(storage);
|
|
||||||
}
|
|
||||||
auto entry = cache->resolveEntry("libraries", storage);
|
auto entry = cache->resolveEntry("libraries", storage);
|
||||||
if(stale)
|
if(stale)
|
||||||
{
|
{
|
||||||
@@ -262,11 +242,6 @@ bool Library::isInstanceLocal() const
|
|||||||
return m_hint == "local";
|
return m_hint == "local";
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Library::isLocalBuilt() const
|
|
||||||
{
|
|
||||||
return localBuild;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool Library::isAlwaysStale() const
|
bool Library::isAlwaysStale() const
|
||||||
{
|
{
|
||||||
return m_hint == "always-stale";
|
return m_hint == "always-stale";
|
||||||
|
@@ -48,8 +48,6 @@ public:
|
|||||||
newlib->m_rules = base->m_rules;
|
newlib->m_rules = base->m_rules;
|
||||||
newlib->m_mojangDownloads = base->m_mojangDownloads;
|
newlib->m_mojangDownloads = base->m_mojangDownloads;
|
||||||
newlib->m_filename = base->m_filename;
|
newlib->m_filename = base->m_filename;
|
||||||
newlib->presenceOnly = base->presenceOnly;
|
|
||||||
newlib->localBuild = base->localBuild;
|
|
||||||
return newlib;
|
return newlib;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -214,12 +212,6 @@ protected: /* data */
|
|||||||
/// true if the library had a rules section (even empty)
|
/// true if the library had a rules section (even empty)
|
||||||
bool applyRules = false;
|
bool applyRules = false;
|
||||||
|
|
||||||
// MultiMC-specific: the artifact must be present, but is not part of the classpath
|
|
||||||
bool presenceOnly = false;
|
|
||||||
|
|
||||||
// MultiMC-specific: the artifact must be present, but cannot be downloaded, because it was created by some other mechanism
|
|
||||||
bool localBuild = false;
|
|
||||||
|
|
||||||
/// rules associated with the library
|
/// rules associated with the library
|
||||||
QList<std::shared_ptr<Rule>> m_rules;
|
QList<std::shared_ptr<Rule>> m_rules;
|
||||||
|
|
||||||
|
@@ -21,14 +21,6 @@ LibraryPtr OneSixVersionFormat::libraryFromJson(const QJsonObject &libObj, const
|
|||||||
readString(libObj, "MMC-absoluteUrl", out->m_absoluteURL);
|
readString(libObj, "MMC-absoluteUrl", out->m_absoluteURL);
|
||||||
readString(libObj, "MMC-filename", out->m_filename);
|
readString(libObj, "MMC-filename", out->m_filename);
|
||||||
readString(libObj, "MMC-displayname", out->m_displayname);
|
readString(libObj, "MMC-displayname", out->m_displayname);
|
||||||
if (libObj.contains("presenceOnly"))
|
|
||||||
{
|
|
||||||
out->presenceOnly = requireBoolean(libObj, "presenceOnly");
|
|
||||||
}
|
|
||||||
if (libObj.contains("localBuild"))
|
|
||||||
{
|
|
||||||
out->localBuild = requireBoolean(libObj, "localBuild");
|
|
||||||
}
|
|
||||||
return out;
|
return out;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -43,10 +35,6 @@ QJsonObject OneSixVersionFormat::libraryToJson(Library *library)
|
|||||||
libRoot.insert("MMC-filename", library->m_filename);
|
libRoot.insert("MMC-filename", library->m_filename);
|
||||||
if (library->m_displayname.size())
|
if (library->m_displayname.size())
|
||||||
libRoot.insert("MMC-displayname", library->m_displayname);
|
libRoot.insert("MMC-displayname", library->m_displayname);
|
||||||
if (library->presenceOnly)
|
|
||||||
libRoot.insert("presenceOnly", true);
|
|
||||||
if (library->localBuild)
|
|
||||||
libRoot.insert("localBuild", true);
|
|
||||||
return libRoot;
|
return libRoot;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user