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

Method processFlame

launcher/InstanceImportTask.cpp:204–411  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

202}
203
204void InstanceImportTask::processFlame()
205{
206 const static QMap<QString,QString> forgemap = {
207 {"1.2.5", "3.4.9.171"},
208 {"1.4.2", "6.0.1.355"},
209 {"1.4.7", "6.6.2.534"},
210 {"1.5.2", "7.8.1.737"}
211 };
212 Flame::Manifest pack;
213 try
214 {
215 QString configPath = FS::PathCombine(m_stagingPath, "manifest.json");
216 Flame::loadManifest(pack, configPath);
217 QFile::remove(configPath);
218 }
219 catch (const JSONValidationError &e)
220 {
221 emitFailed(tr("Could not understand pack manifest:\n") + e.cause());
222 return;
223 }
224 if(!pack.overrides.isEmpty())
225 {
226 QString overridePath = FS::PathCombine(m_stagingPath, pack.overrides);
227 if (QFile::exists(overridePath))
228 {
229 QString mcPath = FS::PathCombine(m_stagingPath, "minecraft");
230 if (!QFile::rename(overridePath, mcPath))
231 {
232 emitFailed(tr("Could not rename the overrides folder:\n") + pack.overrides);
233 return;
234 }
235 }
236 else
237 {
238 logWarning(tr("The specified overrides folder (%1) is missing. Maybe the modpack was already used before?").arg(pack.overrides));
239 }
240 }
241
242 QString forgeVersion;
243 QString fabricVersion;
244 for(auto &loader: pack.minecraft.modLoaders)
245 {
246 auto id = loader.id;
247 if(id.startsWith("forge-"))
248 {
249 id.remove("forge-");
250 forgeVersion = id;
251 continue;
252 }
253 if(id.startsWith("fabric-"))
254 {
255 id.remove("fabric-");
256 fabricVersion = id;
257 continue;
258 }
259 logWarning(tr("Unknown mod loader in manifest: %1").arg(id));
260 }
261

Callers

nothing calls this directly

Calls 15

PathCombineFunction · 0.85
deletePathFunction · 0.85
causeMethod · 0.80
isEmptyMethod · 0.80
getPackProfileMethod · 0.80
buildingFromScratchMethod · 0.80
setComponentVersionMethod · 0.80
setIconKeyMethod · 0.80
installJarModsMethod · 0.80
networkMethod · 0.80
getResultsMethod · 0.80
addNetActionMethod · 0.80

Tested by

no test coverage detected