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

Method applyLibrary

launcher/minecraft/LaunchProfile.cpp:129–159  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

127}
128
129void LaunchProfile::applyLibrary(LibraryPtr library)
130{
131 if(!library->isActive())
132 {
133 return;
134 }
135
136 QList<LibraryPtr> * list = &m_libraries;
137 if(library->isNative())
138 {
139 list = &m_nativeLibraries;
140 }
141
142 auto libraryCopy = Library::limitedCopy(library);
143
144 // find the library by name.
145 const int index = findLibraryByName(list, library->rawName());
146 // library not found? just add it.
147 if (index < 0)
148 {
149 list->append(libraryCopy);
150 return;
151 }
152
153 auto existingLibrary = list->at(index);
154 // if we are higher it means we should update
155 if (Version(library->version()) > Version(existingLibrary->version()))
156 {
157 list->replace(index, libraryCopy);
158 }
159}
160
161void LaunchProfile::applyMavenFile(LibraryPtr mavenFile)
162{

Callers 1

applyToMethod · 0.80

Calls 8

findLibraryByNameFunction · 0.85
isNativeMethod · 0.80
appendMethod · 0.80
VersionClass · 0.70
isActiveMethod · 0.45
atMethod · 0.45
versionMethod · 0.45
replaceMethod · 0.45

Tested by

no test coverage detected