Update the forge hacks.

Conflicts:
	logic/ForgeInstaller.cpp
This commit is contained in:
Petr Mrázek 2014-07-07 08:40:03 +02:00
parent 7f4073840a
commit 842328df8e

View File

@ -133,24 +133,37 @@ bool ForgeInstaller::add(OneSixInstance *to)
int sliding_insert_window = 0; int sliding_insert_window = 0;
{ {
QJsonArray librariesPlus; QJsonArray librariesPlus;
// A blacklist - we ignore these entirely
// for each library in the version we are adding (except for the blacklisted)
QSet<QString> blacklist{"lwjgl", "lwjgl_util", "lwjgl-platform"}; QSet<QString> blacklist{"lwjgl", "lwjgl_util", "lwjgl-platform"};
QList<QString> xzlist{"org.scala-lang", "com.typesafe"};
// for each library in the version we are adding (except for the blacklisted)
for (auto lib : m_forge_version->libraries) for (auto lib : m_forge_version->libraries)
{ {
QString libName = lib->name(); QString libName = lib->name();
QString rawName = lib->rawName();
// ignore blacklisted stuff
if (blacklist.contains(libName))
continue;
// WARNING: This could actually break. // WARNING: This could actually break.
// if this is the actual forge lib, set an absolute url for the download // if this is the actual forge lib, set an absolute url for the download
if (libName.contains("minecraftforge")) if (libName.contains("minecraftforge"))
{ {
lib->setAbsoluteUrl(m_universal_url); lib->setAbsoluteUrl(m_universal_url);
} }
else if (libName.contains("scala"))
// WARNING: This could actually break.
// mark bad libraries based on the xzlist above
for(auto entry : xzlist)
{
QLOG_DEBUG() << "Testing " << rawName << " : " << entry;
if(rawName.startsWith(entry))
{ {
lib->setHint("forge-pack-xz"); lib->setHint("forge-pack-xz");
break;
}
} }
if (blacklist.contains(libName))
continue;
QJsonObject libObj = lib->toJson(); QJsonObject libObj = lib->toJson();