Allow BungeeCord plugins that use bungee.yml (#698)

Co-authored-by: Emma Alexia Triphora <emma@modrinth.com>
This commit is contained in:
Konicai 2023-09-10 12:49:35 -04:00 committed by GitHub
parent 6288f679b9
commit 5fb00a947c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

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