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

Method executeTask

launcher/minecraft/launch/CreateGameFolders.cpp:10–28  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

8}
9
10void CreateGameFolders::executeTask()
11{
12 auto instance = m_parent->instance();
13 std::shared_ptr<MinecraftInstance> minecraftInstance = std::dynamic_pointer_cast<MinecraftInstance>(instance);
14
15 if(!FS::ensureFolderPathExists(minecraftInstance->gameRoot()))
16 {
17 emit logLine("Couldn't create the main game folder", MessageLevel::Error);
18 emitFailed(tr("Couldn't create the main game folder"));
19 return;
20 }
21
22 // HACK: this is a workaround for MCL-3732 - 'server-resource-packs' folder is created.
23 if(!FS::ensureFolderPathExists(FS::PathCombine(minecraftInstance->gameRoot(), "server-resource-packs")))
24 {
25 emit logLine("Couldn't create the 'server-resource-packs' folder", MessageLevel::Error);
26 }
27 emitSucceeded();
28}

Callers

nothing calls this directly

Calls 4

ensureFolderPathExistsFunction · 0.85
PathCombineFunction · 0.85
instanceMethod · 0.45
gameRootMethod · 0.45

Tested by

no test coverage detected