update validators (#678)

This commit is contained in:
Geometrically
2023-08-08 14:27:38 -07:00
committed by GitHub
parent 5676a13290
commit a5195920fa
2 changed files with 5 additions and 28 deletions

View File

@@ -30,19 +30,11 @@ impl super::Validator for ForgeValidator {
&self,
archive: &mut ZipArchive<Cursor<bytes::Bytes>>,
) -> Result<ValidationResult, ValidationError> {
if archive.by_name("META-INF/mods.toml").is_err() {
return Ok(ValidationResult::Warning(
"No mods.toml present for Forge file.",
));
}
if !archive.file_names().any(|name| name.ends_with(".class")) {
return Ok(ValidationResult::Warning(
"Forge mod file is a source file!",
));
}
//TODO: Check if file is a dev JAR?
// if archive.by_name("META-INF/mods.toml").is_err() {
// return Ok(ValidationResult::Warning(
// "No mods.toml present for Forge file.",
// ));
// }
Ok(ValidationResult::Pass)
}
@@ -87,12 +79,6 @@ impl super::Validator for LegacyForgeValidator {
));
};
if !archive.file_names().any(|name| name.ends_with(".class")) {
return Ok(ValidationResult::Warning(
"Forge mod file is a source file!",
));
}
//TODO: Check if file is a dev JAR?
Ok(ValidationResult::Pass)

View File

@@ -35,15 +35,6 @@ impl super::Validator for QuiltValidator {
));
}
if !archive
.file_names()
.any(|name| name.ends_with("refmap.json") || name.ends_with(".class"))
{
return Ok(ValidationResult::Warning(
"Quilt mod file is a source file!",
));
}
Ok(ValidationResult::Pass)
}
}