Skip to content

Commit 19b341e

Browse files
authored
Merge pull request #2 from yaalyy/log-clear
cleaned repeated log when native patcher is triggered
2 parents 672abad + 24de3e2 commit 19b341e

1 file changed

Lines changed: 3 additions & 6 deletions

File tree

HMCL/src/main/java/org/jackhuang/hmcl/util/NativePatcher.java

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -150,25 +150,22 @@ public static Version patchNative(DefaultGameRepository repository,
150150

151151
if (library.isNative()) {
152152
String nativeKey = library.getName() + ":natives";
153+
String matchedKey = nativeKey;
153154
Library replacement = replacements.getOrDefault(nativeKey, NONEXISTENT_LIBRARY);
154155
if (replacement == NONEXISTENT_LIBRARY) {
155156
String classifier = library.getClassifier();
156157
if (classifier != null) {
157158
String classifierKey = library.getName() + ":" + classifier;
158159
replacement = replacements.getOrDefault(classifierKey, NONEXISTENT_LIBRARY);
159-
if (replacement != NONEXISTENT_LIBRARY) {
160-
LOG.info("Replace " + classifierKey + " with " + replacement.getName());
161-
}
160+
matchedKey = classifierKey;
162161
}
163-
} else if (replacement != null) {
164-
LOG.info("Replace " + nativeKey + " with " + replacement.getName());
165162
}
166163

167164
if (replacement == NONEXISTENT_LIBRARY) {
168165
LOG.warning("No alternative native library " + library.getName() + ":natives provided for platform " + javaVersion.getPlatform());
169166
newLibraries.add(library);
170167
} else if (replacement != null) {
171-
LOG.info("Replace " + library.getName() + ":natives with " + replacement.getName());
168+
LOG.info("Replace " + matchedKey + " with " + replacement.getName());
172169
newLibraries.add(replacement);
173170
}
174171
} else {

0 commit comments

Comments
 (0)