Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions HMCLCore/src/main/java/org/jackhuang/hmcl/mod/ModManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -365,14 +365,16 @@ public static boolean isFileMod(Path modFile) {
}

/**
* Check if "mods" directory has mod file named "fileName" no matter the mod is disabled or not
* Check if "mods" directory has mod file named "fileName" no matter the mod is disabled,upgraded or not
*
* @param fileName name of the file whose existence is being checked
* @return true if the file exists
*/
public boolean hasSimpleMod(String fileName) {
return Files.exists(getModsDirectory().resolve(StringUtils.removeSuffix(fileName, DISABLED_EXTENSION)))
|| Files.exists(getModsDirectory().resolve(StringUtils.addSuffix(fileName, DISABLED_EXTENSION)));
|| Files.exists(getModsDirectory().resolve(StringUtils.addSuffix(fileName, DISABLED_EXTENSION)))
|| Files.exists(getModsDirectory().resolve(StringUtils.removeSuffix(fileName, OLD_EXTENSION)))
|| Files.exists(getModsDirectory().resolve(StringUtils.addSuffix(fileName, OLD_EXTENSION)));
}

public Path getSimpleModPath(String fileName) {
Expand Down