aboutsummaryrefslogtreecommitdiff
path: root/api/logic/minecraft/Library.cpp
diff options
context:
space:
mode:
authorPetr Mrázek <peterix@gmail.com>2020-05-19 15:13:16 +0200
committerPetr Mrázek <peterix@gmail.com>2020-05-19 15:13:16 +0200
commite7f79c90764e03b3ba41af8352bdd167cd1db2b2 (patch)
tree8664088d5bd72377feb862c6a6b7f013ebe1008a /api/logic/minecraft/Library.cpp
parent9eaa636908076d7b767e05e4dea4d579cfbbfd4b (diff)
downloadPrismLauncher-e7f79c90764e03b3ba41af8352bdd167cd1db2b2.tar.gz
PrismLauncher-e7f79c90764e03b3ba41af8352bdd167cd1db2b2.tar.bz2
PrismLauncher-e7f79c90764e03b3ba41af8352bdd167cd1db2b2.zip
Remove some old forge hacks
Forge apparently removed all `.pack.xz` files without warning. It broke a bunch of stuff, as always. But it also means we don't need some ugly code anymore. This is removed: - Support for 'forge-pack-xz' and the forge-specific file download compression. - The pack200 library we no longer need. This stays: - The LZMA decompression library - we may still want to use it.
Diffstat (limited to 'api/logic/minecraft/Library.cpp')
-rw-r--r--api/logic/minecraft/Library.cpp31
1 files changed, 9 insertions, 22 deletions
diff --git a/api/logic/minecraft/Library.cpp b/api/logic/minecraft/Library.cpp
index a56e8110..9ff8dcdc 100644
--- a/api/logic/minecraft/Library.cpp
+++ b/api/logic/minecraft/Library.cpp
@@ -3,7 +3,6 @@
#include <net/Download.h>
#include <net/ChecksumValidator.h>
-#include <minecraft/forge/ForgeXzDownload.h>
#include <Env.h>
#include <FileSystem.h>
@@ -88,26 +87,19 @@ QList< std::shared_ptr< NetAction > > Library::getDownloads(
{
options |= Net::Download::Option::AcceptLocalFiles;
}
- if (isForge())
+
+ if(sha1.size())
{
- qDebug() << "XzDownload for:" << rawName() << "storage:" << storage << "url:" << url;
- out.append(ForgeXzDownload::make(url, storage, entry));
+ auto rawSha1 = QByteArray::fromHex(sha1.toLatin1());
+ auto dl = Net::Download::makeCached(url, entry, options);
+ dl->addValidator(new Net::ChecksumValidator(QCryptographicHash::Sha1, rawSha1));
+ qDebug() << "Checksummed Download for:" << rawName() << "storage:" << storage << "url:" << url;
+ out.append(dl);
}
else
{
- if(sha1.size())
- {
- auto rawSha1 = QByteArray::fromHex(sha1.toLatin1());
- auto dl = Net::Download::makeCached(url, entry, options);
- dl->addValidator(new Net::ChecksumValidator(QCryptographicHash::Sha1, rawSha1));
- qDebug() << "Checksummed Download for:" << rawName() << "storage:" << storage << "url:" << url;
- out.append(dl);
- }
- else
- {
- out.append(Net::Download::makeCached(url, entry, options));
- qDebug() << "Download for:" << rawName() << "storage:" << storage << "url:" << url;
- }
+ out.append(Net::Download::makeCached(url, entry, options));
+ qDebug() << "Download for:" << rawName() << "storage:" << storage << "url:" << url;
}
return true;
};
@@ -243,11 +235,6 @@ bool Library::isAlwaysStale() const
return m_hint == "always-stale";
}
-bool Library::isForge() const
-{
- return m_hint == "forge-pack-xz";
-}
-
void Library::setStoragePrefix(QString prefix)
{
m_storagePrefix = prefix;