diff --git a/HMCLCore/src/main/java/org/jackhuang/hmcl/mod/modinfo/ForgeNewModMetadata.java b/HMCLCore/src/main/java/org/jackhuang/hmcl/mod/modinfo/ForgeNewModMetadata.java index 5e14f90262..566ac2aeb4 100644 --- a/HMCLCore/src/main/java/org/jackhuang/hmcl/mod/modinfo/ForgeNewModMetadata.java +++ b/HMCLCore/src/main/java/org/jackhuang/hmcl/mod/modinfo/ForgeNewModMetadata.java @@ -293,7 +293,7 @@ private static LocalModFile fromEmbeddedMod(ModManager modManager, Path modFile, throw new IOException(); } - private static ModLoaderType analyzeLoader(Toml toml, String modID, ModLoaderType loader) throws IOException { + private static ModLoaderType analyzeLoader(Toml toml, String modID, ModLoaderType loader) { List> dependencies = null; try { dependencies = toml.getList("dependencies." + modID); @@ -332,11 +332,11 @@ private static ModLoaderType analyzeLoader(Toml toml, String modID, ModLoaderTyp } } - if (result == loader) + if (result != null) { + if (result != loader) + LOG.warning("Loader mismatch for mod " + modID + ", found " + result + ", expecting " + loader); return result; - else if (result != null) - throw new IOException("Loader mismatch"); - else { + } else { LOG.warning("Cannot determine the mod loader for mod " + modID + ", expected " + loader); return loader; }