diff options
author | Petr Mrázek <peterix@gmail.com> | 2016-11-17 01:21:49 +0100 |
---|---|---|
committer | Petr Mrázek <peterix@gmail.com> | 2016-11-17 01:21:49 +0100 |
commit | fd34ca5a0f4492c4b280df8aa3d9d82154b5d9bc (patch) | |
tree | 8fa95d24d9c50335378806910d8caa4073fb61ca /api/logic/minecraft/launch | |
parent | 9cf8b42d8923454b335159b08cc6dd551afd9301 (diff) | |
download | MultiMC-fd34ca5a0f4492c4b280df8aa3d9d82154b5d9bc.tar MultiMC-fd34ca5a0f4492c4b280df8aa3d9d82154b5d9bc.tar.gz MultiMC-fd34ca5a0f4492c4b280df8aa3d9d82154b5d9bc.tar.lz MultiMC-fd34ca5a0f4492c4b280df8aa3d9d82154b5d9bc.tar.xz MultiMC-fd34ca5a0f4492c4b280df8aa3d9d82154b5d9bc.zip |
NOISSUE always run the ExtractNatives task during launch
The task now checks the conditions, giving the update process time
to supply all the metadata.
Diffstat (limited to 'api/logic/minecraft/launch')
-rw-r--r-- | api/logic/minecraft/launch/ExtractNatives.cpp | 15 | ||||
-rw-r--r-- | api/logic/minecraft/launch/ExtractNatives.h | 5 |
2 files changed, 17 insertions, 3 deletions
diff --git a/api/logic/minecraft/launch/ExtractNatives.cpp b/api/logic/minecraft/launch/ExtractNatives.cpp index 089e2559..30b5197b 100644 --- a/api/logic/minecraft/launch/ExtractNatives.cpp +++ b/api/logic/minecraft/launch/ExtractNatives.cpp @@ -71,8 +71,13 @@ void ExtractNatives::executeTask() { auto instance = m_parent->instance(); std::shared_ptr<MinecraftInstance> minecraftInstance = std::dynamic_pointer_cast<MinecraftInstance>(instance); - auto outputPath = minecraftInstance->getNativePath(); auto toExtract = minecraftInstance->getNativeJars(); + if(toExtract.isEmpty()) + { + emitSucceeded(); + return; + } + auto outputPath = minecraftInstance->getNativePath(); auto javaVersion = minecraftInstance->getJavaVersion(); bool jniHackEnabled = javaVersion.major() >= 8; for(const auto &source: toExtract) @@ -84,3 +89,11 @@ void ExtractNatives::executeTask() } emitSucceeded(); } + +void ExtractNatives::finalize() +{ + auto instance = m_parent->instance(); + QString target_dir = FS::PathCombine(instance->instanceRoot(), "natives/"); + QDir dir(target_dir); + dir.removeRecursively(); +} diff --git a/api/logic/minecraft/launch/ExtractNatives.h b/api/logic/minecraft/launch/ExtractNatives.h index 699657d7..0c5c831c 100644 --- a/api/logic/minecraft/launch/ExtractNatives.h +++ b/api/logic/minecraft/launch/ExtractNatives.h @@ -27,11 +27,12 @@ public: explicit ExtractNatives(LaunchTask *parent) : LaunchStep(parent){}; virtual ~ExtractNatives(){}; - virtual void executeTask(); - virtual bool canAbort() const + void executeTask() override; + bool canAbort() const override { return false; } + void finalize() override; }; |