MCPcopy Create free account
hub / github.com/FreesmTeam/FreesmLauncher / executeTask

Method executeTask

launcher/minecraft/launch/ExtractNatives.cpp:70–92  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

68}
69
70void ExtractNatives::executeTask()
71{
72 auto instance = m_parent->instance();
73 auto toExtract = instance->getNativeJars();
74 if (toExtract.isEmpty()) {
75 emitSucceeded();
76 return;
77 }
78 auto settings = instance->settings();
79
80 auto outputPath = instance->getNativePath();
81 FS::ensureFolderPathExists(outputPath);
82 auto javaVersion = instance->getJavaVersion();
83 bool jniHackEnabled = javaVersion.major() >= 8;
84 for (const auto& source : toExtract) {
85 if (!unzipNatives(source, outputPath, jniHackEnabled)) {
86 const char* reason = QT_TR_NOOP("Couldn't extract native jar '%1' to destination '%2'");
87 emit logLine(QString(reason).arg(source, outputPath), MessageLevel::Fatal);
88 emitFailed(tr(reason).arg(source, outputPath));
89 }
90 }
91 emitSucceeded();
92}
93
94void ExtractNatives::finalize()
95{

Callers

nothing calls this directly

Calls 10

ensureFolderPathExistsFunction · 0.85
unzipNativesFunction · 0.85
QStringClass · 0.85
getNativeJarsMethod · 0.80
getNativePathMethod · 0.80
getJavaVersionMethod · 0.80
majorMethod · 0.80
instanceMethod · 0.45
isEmptyMethod · 0.45
settingsMethod · 0.45

Tested by

no test coverage detected