Added Paper Plugins support (#673)

Co-authored-by: Geometrically <18202329+Geometrically@users.noreply.github.com>
This commit is contained in:
Adrian 2023-08-07 13:53:21 -05:00 committed by GitHub
parent ae3a39ee65
commit 4b07ee2fa8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -32,11 +32,14 @@ impl super::Validator for PluginYmlValidator {
&self,
archive: &mut ZipArchive<Cursor<bytes::Bytes>>,
) -> Result<ValidationResult, ValidationError> {
if archive.by_name("plugin.yml").is_err() {
if !archive
.file_names()
.any(|name| name == "plugin.yml" || name == "paper-plugin.yml")
{
return Ok(ValidationResult::Warning(
"No plugin.yml present for plugin file.",
"No plugin.yml or paper-plugin.yml present for plugin file.",
));
}
};
Ok(ValidationResult::Pass)
}