Skip to content

Commit

Permalink
Fix: Disambiguate libraries by their module name.
Browse files Browse the repository at this point in the history
  • Loading branch information
LlamaLad7 committed Oct 23, 2024
1 parent cf7f3db commit 801adda
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,13 @@ private String formatError(final ModWithVersionRange modWithVersionRange) {
}

protected String identifyMod(final IModFile modFile) {
if (modFile.getModFileInfo() == null || modFile.getModInfos().isEmpty()) {
if (modFile.getModFileInfo() == null) {
return modFile.getFileName();
}
// If this is a library, it won't have any mod IDs, so we use the module name instead.
if (modFile.getModInfos().isEmpty()) {
return modFile.getModFileInfo().moduleName();
}

return modFile.getModInfos().stream().map(IModInfo::getModId).collect(Collectors.joining());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,12 +140,12 @@ public IConfigurable getConfig() {
return configurable;
}

// These Should never be called as it's only called from ModJarMetadata.version and we bypass that
@Override
public String moduleName() {
return mod.getSecureJar().name();
}

// These Should never be called as it's only called from ModJarMetadata.version and we bypass that
@Override
public String versionString() {
return null;
Expand Down

0 comments on commit 801adda

Please sign in to comment.