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,
|
&self,
|
||||||
archive: &mut ZipArchive<Cursor<bytes::Bytes>>,
|
archive: &mut ZipArchive<Cursor<bytes::Bytes>>,
|
||||||
) -> Result<ValidationResult, ValidationError> {
|
) -> Result<ValidationResult, ValidationError> {
|
||||||
if archive.by_name("META-INF/mods.toml").is_err() {
|
// if archive.by_name("META-INF/mods.toml").is_err() {
|
||||||
return Ok(ValidationResult::Warning(
|
// return Ok(ValidationResult::Warning(
|
||||||
"No mods.toml present for Forge file.",
|
// "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?
|
|
||||||
|
|
||||||
Ok(ValidationResult::Pass)
|
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?
|
//TODO: Check if file is a dev JAR?
|
||||||
|
|
||||||
Ok(ValidationResult::Pass)
|
Ok(ValidationResult::Pass)
|
||||||
|
|||||||
@@ -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)
|
Ok(ValidationResult::Pass)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user