NOISSUE always run the ExtractNatives task during launch

The task now checks the conditions, giving the update process time
to supply all the metadata.
This commit is contained in:
Petr Mrázek
2016-11-17 01:21:49 +01:00
parent 9cf8b42d89
commit fd34ca5a0f
10 changed files with 17 additions and 33 deletions

View File

@ -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();
}