Skip to content
This repository has been archived by the owner on Oct 19, 2024. It is now read-only.

Commit

Permalink
Fix neoforge check, make forge validator more lenient (#928)
Browse files Browse the repository at this point in the history
  • Loading branch information
Geometrically authored Jun 14, 2024
1 parent 608e55c commit 5148e27
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/validate/forge.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ impl super::Validator for ForgeValidator {
archive: &mut ZipArchive<Cursor<bytes::Bytes>>,
) -> Result<ValidationResult, ValidationError> {
if archive.by_name("META-INF/mods.toml").is_err()
&& archive.by_name("META-INF/MANIFEST.MF").is_err()
&& !archive.file_names().any(|x| x.ends_with(".class"))
{
return Ok(ValidationResult::Warning(
Expand Down Expand Up @@ -70,6 +71,7 @@ impl super::Validator for LegacyForgeValidator {
archive: &mut ZipArchive<Cursor<bytes::Bytes>>,
) -> Result<ValidationResult, ValidationError> {
if archive.by_name("mcmod.info").is_err()
&& archive.by_name("META-INF/MANIFEST.MF").is_err()
&& !archive.file_names().any(|x| x.ends_with(".class"))
{
return Ok(ValidationResult::Warning(
Expand Down
3 changes: 2 additions & 1 deletion src/validate/neoforge.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ impl super::Validator for NeoForgeValidator {
}

fn get_supported_loaders(&self) -> &[&str] {
&["forge"]
&["neoforge"]
}

fn get_supported_game_versions(&self) -> SupportedGameVersions {
Expand All @@ -23,6 +23,7 @@ impl super::Validator for NeoForgeValidator {
) -> Result<ValidationResult, ValidationError> {
if archive.by_name("META-INF/mods.toml").is_err()
&& archive.by_name("META-INF/neoforge.mods.toml").is_err()
&& archive.by_name("META-INF/MANIFEST.MF").is_err()
&& !archive.file_names().any(|x| x.ends_with(".class"))
{
return Ok(ValidationResult::Warning(
Expand Down

0 comments on commit 5148e27

Please sign in to comment.