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

Method getApplicableFiles

launcher/minecraft/Library.cpp:45–80  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

43
44
45void Library::getApplicableFiles(const RuntimeContext & runtimeContext, QStringList& jar, QStringList& native, QStringList& native32,
46 QStringList& native64, const QString &overridePath) const
47{
48 bool local = isLocal();
49 auto actualPath = [&](QString relPath)
50 {
51 QFileInfo out(FS::PathCombine(storagePrefix(), relPath));
52 if(local && !overridePath.isEmpty())
53 {
54 QString fileName = out.fileName();
55 return QFileInfo(FS::PathCombine(overridePath, fileName)).absoluteFilePath();
56 }
57 return out.absoluteFilePath();
58 };
59 QString raw_storage = storageSuffix(runtimeContext);
60 if(isNative())
61 {
62 if (raw_storage.contains("${arch}"))
63 {
64 auto nat32Storage = raw_storage;
65 nat32Storage.replace("${arch}", "32");
66 auto nat64Storage = raw_storage;
67 nat64Storage.replace("${arch}", "64");
68 native32 += actualPath(nat32Storage);
69 native64 += actualPath(nat64Storage);
70 }
71 else
72 {
73 native += actualPath(raw_storage);
74 }
75 }
76 else
77 {
78 jar += actualPath(raw_storage);
79 }
80}
81
82QList<NetAction::Ptr> Library::getDownloads(
83 const RuntimeContext & runtimeContext,

Callers 14

extraArgumentsMethod · 0.80
getJarModsMethod · 0.80
getLibraryFilesMethod · 0.80
executeTaskMethod · 0.80
test_legacyMethod · 0.80
test_legacy_nativeMethod · 0.80
test_onenineMethod · 0.80

Calls 4

PathCombineFunction · 0.85
isEmptyMethod · 0.80
containsMethod · 0.45
replaceMethod · 0.45

Tested by 9

test_legacyMethod · 0.64
test_legacy_nativeMethod · 0.64
test_onenineMethod · 0.64
test_onenine_nativeMethod · 0.64