MCPcopy Create free account
hub / github.com/PolyMC/PolyMC / fmllibsFinished

Method fmllibsFinished

launcher/minecraft/update/FMLLibrariesTask.cpp:87–116  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

85}
86
87void FMLLibrariesTask::fmllibsFinished()
88{
89 downloadJob.reset();
90 if (!fmlLibsToProcess.isEmpty())
91 {
92 setStatus(tr("Copying FML libraries into the instance..."));
93 MinecraftInstance *inst = (MinecraftInstance *)m_inst;
94 auto metacache = APPLICATION->metacache();
95 int index = 0;
96 for (auto &lib : fmlLibsToProcess)
97 {
98 progress(index, fmlLibsToProcess.size());
99 auto entry = metacache->resolveEntry("fmllibs", lib.filename);
100 auto path = FS::PathCombine(inst->libDir(), lib.filename);
101 if (!FS::ensureFilePathExists(path))
102 {
103 emitFailed(tr("Failed creating FML library folder inside the instance."));
104 return;
105 }
106 if (!QFile::copy(entry->getFullPath(), FS::PathCombine(inst->libDir(), lib.filename)))
107 {
108 emitFailed(tr("Failed copying Forge/FML library: %1.").arg(lib.filename));
109 return;
110 }
111 index++;
112 }
113 progress(index, fmlLibsToProcess.size());
114 }
115 emitSucceeded();
116}
117void FMLLibrariesTask::fmllibsFailed(QString reason)
118{
119 QStringList failed = downloadJob->getFailedFiles();

Callers

nothing calls this directly

Calls 10

PathCombineFunction · 0.85
ensureFilePathExistsFunction · 0.85
copyClass · 0.85
isEmptyMethod · 0.80
metacacheMethod · 0.80
resolveEntryMethod · 0.80
libDirMethod · 0.80
getFullPathMethod · 0.80
resetMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected