MCPcopy Create free account
hub / github.com/MultiMC/Launcher / executeTask

Method executeTask

launcher/minecraft/launch/ExtractNatives.cpp:76–103  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

74}
75
76void ExtractNatives::executeTask()
77{
78 auto instance = m_parent->instance();
79 std::shared_ptr<MinecraftInstance> minecraftInstance = std::dynamic_pointer_cast<MinecraftInstance>(instance);
80 auto toExtract = minecraftInstance->getNativeJars();
81 if(toExtract.isEmpty())
82 {
83 emitSucceeded();
84 return;
85 }
86 auto settings = minecraftInstance->settings();
87 bool nativeOpenAL = settings->get("UseNativeOpenAL").toBool();
88 bool nativeGLFW = settings->get("UseNativeGLFW").toBool();
89
90 auto outputPath = minecraftInstance->getNativePath();
91 auto javaVersion = minecraftInstance->getJavaVersion();
92 bool jniHackEnabled = javaVersion.major() >= 8;
93 for(const auto &source: toExtract)
94 {
95 if(!unzipNatives(source, outputPath, jniHackEnabled, nativeOpenAL, nativeGLFW))
96 {
97 const char *reason = QT_TR_NOOP("Couldn't extract native jar '%1' to destination '%2'");
98 emit logLine(QString(reason).arg(source, outputPath), MessageLevel::Fatal);
99 emitFailed(tr(reason).arg(source, outputPath));
100 }
101 }
102 emitSucceeded();
103}
104
105void ExtractNatives::finalize()
106{

Callers

nothing calls this directly

Calls 10

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

Tested by

no test coverage detected