diff --git a/HMCLCore/src/main/java/org/jackhuang/hmcl/mod/ModManager.java b/HMCLCore/src/main/java/org/jackhuang/hmcl/mod/ModManager.java index 6297e49e94..cfc7aeb9db 100644 --- a/HMCLCore/src/main/java/org/jackhuang/hmcl/mod/ModManager.java +++ b/HMCLCore/src/main/java/org/jackhuang/hmcl/mod/ModManager.java @@ -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) {