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

Fix neoforge check, make forge validator more lenient #928

Merged
merged 1 commit into from
Jun 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading