From 5148e27448962dab27a51ae7a1a40104ca057d32 Mon Sep 17 00:00:00 2001 From: Geometrically <18202329+Geometrically@users.noreply.github.com> Date: Fri, 14 Jun 2024 13:16:05 -0700 Subject: [PATCH] Fix neoforge check, make forge validator more lenient (#928) --- src/validate/forge.rs | 2 ++ src/validate/neoforge.rs | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/validate/forge.rs b/src/validate/forge.rs index 3f6ba480..5cb84f72 100644 --- a/src/validate/forge.rs +++ b/src/validate/forge.rs @@ -27,6 +27,7 @@ impl super::Validator for ForgeValidator { archive: &mut ZipArchive>, ) -> Result { if archive.by_name("META-INF/mods.toml").is_err() + && archive.by_name("META-INF/MANIFEST.MF").is_err() && !archive.file_names().any(|x| x.ends_with(".class")) { return Ok(ValidationResult::Warning( @@ -70,6 +71,7 @@ impl super::Validator for LegacyForgeValidator { archive: &mut ZipArchive>, ) -> Result { if archive.by_name("mcmod.info").is_err() + && archive.by_name("META-INF/MANIFEST.MF").is_err() && !archive.file_names().any(|x| x.ends_with(".class")) { return Ok(ValidationResult::Warning( diff --git a/src/validate/neoforge.rs b/src/validate/neoforge.rs index 8e20778e..7291c467 100644 --- a/src/validate/neoforge.rs +++ b/src/validate/neoforge.rs @@ -10,7 +10,7 @@ impl super::Validator for NeoForgeValidator { } fn get_supported_loaders(&self) -> &[&str] { - &["forge"] + &["neoforge"] } fn get_supported_game_versions(&self) -> SupportedGameVersions { @@ -23,6 +23,7 @@ impl super::Validator for NeoForgeValidator { ) -> Result { if archive.by_name("META-INF/mods.toml").is_err() && archive.by_name("META-INF/neoforge.mods.toml").is_err() + && archive.by_name("META-INF/MANIFEST.MF").is_err() && !archive.file_names().any(|x| x.ends_with(".class")) { return Ok(ValidationResult::Warning(