You've already forked AstralRinth
forked from didirus/AstralRinth
update validators (#678)
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user