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:
@ -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();
|
||||
}
|
||||
|
@ -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;
|
||||
};
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user