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

Function processFolder

launcher/minecraft/mod/tasks/LocalResourcePackParseTask.cpp:46–75  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

44}
45
46void processFolder(ResourcePack& pack)
47{
48 Q_ASSERT(pack.type() == ResourceType::FOLDER);
49
50 QFileInfo mcmeta_file_info(FS::PathCombine(pack.fileinfo().filePath(), "pack.mcmeta"));
51 if (mcmeta_file_info.isFile()) {
52 QFile mcmeta_file(mcmeta_file_info.filePath());
53 if (!mcmeta_file.open(QIODevice::ReadOnly))
54 return;
55
56 auto data = mcmeta_file.readAll();
57
58 ResourcePackUtils::processMCMeta(pack, std::move(data));
59
60 mcmeta_file.close();
61 }
62
63 QFileInfo image_file_info(FS::PathCombine(pack.fileinfo().filePath(), "pack.png"));
64 if (image_file_info.isFile()) {
65 QFile mcmeta_file(image_file_info.filePath());
66 if (!mcmeta_file.open(QIODevice::ReadOnly))
67 return;
68
69 auto data = mcmeta_file.readAll();
70
71 ResourcePackUtils::processPackPNG(pack, std::move(data));
72
73 mcmeta_file.close();
74 }
75}
76
77void processZIP(ResourcePack& pack)
78{

Callers 1

processFunction · 0.70

Calls 7

PathCombineFunction · 0.85
processMCMetaFunction · 0.85
filePathMethod · 0.80
fileinfoMethod · 0.80
openMethod · 0.80
processPackPNGFunction · 0.70
typeMethod · 0.45

Tested by

no test coverage detected