diff options
Diffstat (limited to 'api/logic/minecraft/launch/ExtractNatives.cpp')
-rw-r--r-- | api/logic/minecraft/launch/ExtractNatives.cpp | 15 |
1 files changed, 14 insertions, 1 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(); +} |