Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash when mods folder contains jar file without mods.toml #9968

Closed
Yeregorix opened this issue May 9, 2024 · 6 comments
Closed

Crash when mods folder contains jar file without mods.toml #9968

Yeregorix opened this issue May 9, 2024 · 6 comments
Assignees

Comments

@Yeregorix
Copy link

Yeregorix commented May 9, 2024

Minecraft Version: 1.20.4

Forge Version: 49.0.45 (doesn't happen with 49.0.43)

Logs: https://gist.github.com/Yeregorix/9befc77621fb5f9be9d95e70c315ce53
Logs with SpongeForge: https://gist.github.com/Yeregorix/a4717c408fa77ed8f2d7a74bf250319e (nearly identical)

Steps to Reproduce:

  1. Place any jar without mods.toml in the mods folder.
  2. Starts the server.

Description of issue:
Forge crashes when the mods folder contains a jar file without mods.toml. This prevents the installation of SpongeForge plugins.

This issue has likely been introduced by commit e0dccae .

@Yeregorix Yeregorix added the Triage This request requires the active attention of the Triage Team. Requires labelling or reviews. label May 9, 2024
@PaintNinja
Copy link
Contributor

PaintNinja commented May 9, 2024

Could you provide a test jar please? The commit you're referencing should not have any impact for your scenario, as it only applies to mod jars that contain an invalid mods.toml. It shouldn't make a difference for jars missing a mods.toml altogether

@Jonathing
Copy link
Member

Since this issue mentions a log with SpongeForge, I am going to assume that you are attempting to load a Sponge plugin with Forge. Since Sponge should load plugins from the plugins folder, there's really no reason for you to be putting your Sponge plugin in the mods folder.

If I recall correctly, Forge not playing nice with non-Forge mods in the mods folder is intended behavior, to attempt to inform the user that they might not be using the correct build of a mod for Forge (i.e. they might've downloaded a Fabric mod and are trying to use it on Forge). I invite @PaintNinja to correct me if I'm wrong.

Regardless, here's WorldEdit for Sponge. I just yoinked it off of Ore since it's one of their most downloaded plugins: WorldEdit 7.2.16+6534-206eb4

@Yeregorix
Copy link
Author

You can use any jar that doesn't have a mods.toml. The TestPlugin.jar in the logs is just a small jar I built locally and isn't hosted anywhere. I just tried with https://ore.spongepowered.org/Yeregorix/AutoPickup/versions/1.2.0 and I get the same error. You can also use WorldEdit yes.

@Asbestosstar
Copy link

Asbestosstar commented May 10, 2024

I have similar issue when including FabricMC mods in the folder or FeatureCreep mods when they end in .jar. FeatureCreep (which I am the lead dev of) looks for custom jars in the mods folder and since CurseForge only allows a small number of extensions there is little choice than having them set .jar and other abstraction layers may have issues as well especially since most modpack formats default to the mods folder.

It provides an error on the screen saying invalid modfile but does not let me continue loading like before.

This only happens on version 49.0.45 and above or on 1.20.6 versions. On 49.0.43 and before it works fine.

at LAYER PLUGIN/net.minecraftforge.fmlcore@1.20.4-49.0.45/net.minecraftforge.fml.ModLoader.<init>(ModLoader.java:98)
at LAYER PLUGIN/net.minecraftforge.fmlcore@1.20.4-49.0.45/net.minecraftforge.fml.ModLoader.get(ModLoader.java:130)

I know you did some changes around lines 96-98 and that is where it is crashing from

@LordRalex
Copy link

Evidence for @PaintNinja to indicate it worked prior to this release to actually load files:

https://gist.github.com/LordRalex/3aef9ab3f668bb90d03497cc47c2927c#file-debug-log-L2449 - .43 with Sponge, and AutoPickup loading from it:

https://gist.github.com/LordRalex/a91879a92b3b7e65e3d6099fa93674fa .45 where it fails

@autoforge autoforge bot removed the Triage This request requires the active attention of the Triage Team. Requires labelling or reviews. label May 12, 2024
@LexManos
Copy link
Member

LexManos commented May 12, 2024

So the issue is that your change to actually respect loading errors meant that a previously silently ignored exception was surfaced.

So ya, Jonathing is correct that warning users about non-forge mods in the mods folder WAS an intended feature, but due to the poor design of FML it seems that in actuality it was just silently ignored and people have come to rely on that functionality.

So I just made it log a message and ignore the file, should be working as it was before.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants