[1.15.2] missing META-INF/mods.toml in jar file -- mod fails to load
jmbjorndalen opened this issue ยท 14 comments
Modpack: All The mods 5
Forge: 1.15.2 / 31.1.30
Minecraft starts up displays the following warning:
"File MixinBootstrap-1.0.2.jar is not a valid file"
Then the mod appears to be ignored by Forge (you get the same number of mods loaded if you remove MixinBootstrap). The relevant Forge file that seems to trigger this behaviour is ModFile.java that checks for the mods.toml file.
From the warning, you can click "Proceed to main menu" and continue playing, but I assume without this mod.
Relevant debug.log lines (with path names slightly altered for readability):
[31Mar2020 16:50:14.694] [main/DEBUG] [net.minecraftforge.fml.loading.moddiscovery.ModFileParser/LOADING]: Considering mod file candidate /.../atm5/minecraft/mods/MixinBootstrap-1.0.2.jar
[31Mar2020 16:50:14.694] [main/WARN] [net.minecraftforge.fml.loading.moddiscovery.ModFileParser/LOADING]: Mod file Mod File: /.../atm5/minecraft/mods/MixinBootstrap-1.0.2.jar is missing mods.toml file
[31Mar2020 16:50:14.694] [main/WARN] [net.minecraftforge.fml.loading.moddiscovery.ModDiscoverer/SCAN]: File /.../atm5/minecraft/mods/MixinBootstrap-1.0.2.jar has been ignored - it is invalid
Sorry to use this issue for advice, but I am getting the "this is not a valid file" notification and the mod doesn't load which results in a crash because some other mod needs it.
I am using MultiMC with a symbolic link for my mod-folder. Which is probably the issue?
Can someone explain to me in layman terms how I can solve this with a classpath? (can it be solved like that?)
For MultiMC:
- Select the 'Instance' you want to add MixinBootstrap to.
- Click 'Edit Instance' button.
- Click 'Version' tab.
- Click 'Add to Minecraft.jar' button.
- Select the MixinBootstrap jar file.
- Launch the Game.
Note: Loading MixinBootstrap this way may have issues as it hasn't been fully tested.
If you're still having issues please post your debug.log file.
MixinBootstrap is supposed to be blacklisted by Forge due to it containing a cpw.mods.modlauncher.api.ITransformationService
. However you shouldn't be getting any warnings because of this.
Can you please provide a screenshot of the warning and your debug.log file.
Which Launcher are you using?
This may be an issue with GDLauncher Next: https://github.com/gorilla-devs/GDLauncher-Next-Issues/issues/15
What appears to be happening is GDLauncher creates a shortcut under C:\_gdl
, However Forge or ModLauncher resolve the real path to the jar as seen here:
[main/DEBUG] [cpw.mods.modlauncher.TransformationServicesHandler/MODLAUNCHER]: Found additional transformation services from discovery services: [C:\Users\Alex Thomson\...\GDLauncher\data\instances_next\Forge 1.15.2\mods\MixinBootstrap-1.0.2.jar]
Later on during the loading we see Forge attempting to load MixinBootstrap from the shortcut location:
[main/DEBUG] [net.minecraftforge.fml.loading.moddiscovery.ModFileParser/LOADING]: Considering mod file candidate C:\_gdl\instances_next\Forge 1.15.2\mods\MixinBootstrap-1.0.2.jar
Forge would have blacklisted the real path but not the C:\_gdl
path, Because of this Forge is attempting to load MixinBootstrap when it shouldn't be.
I could try to fix this by making MixinBootstrap a valid mod file however if GDLauncher is hiding the real path due to privacy concerns then the fix would have to be done on their end.
Sorry, I looked a bit too high up in my list. The source file involved is this one (ModFileParser.readModList), which prints one of the three lines I included from debug.log:
I'm experiencing this both in the old Java launcher and in GDLauncher 0.12.4.
Image: https://imgur.com/gallery/XQbCaf1
debug.log from Java launcher (slightly edited for uuid and pathnames)
https://gist.github.com/jmbjorndalen/4d125c6642f241daed08d8e63343113a
debug.log from GDLauncher
https://gist.github.com/jmbjorndalen/09cc31d127f4f296062523380f80625e
So forge is not supposed to load the mod at all? Is it loaded directly by other mods instead? If so, I guess the warning is confusing but harmless.
I tried moving everything (profile, forge and modpack) to a separate directory without using any symlinks and then running everything using --workDir. It now starts without the warning.
I created a new gist with the log file for reference:
https://gist.github.com/jmbjorndalen/5d79c715023d11d0299d7f8eb003ec3b
Thanks for your help :)
Yeah that'll be the issue. Forge is blacklisting the real path instead of the shortcut path which is why MixinBootstrap is getting loaded when it shouldn't
Forge is calling toRealPath
which will resolve symbolic links.
I am also encountering this issue and I am confused to why this is happening. I am not using symlinks, but I am using GDLauncher Next. What can I do to resolve this?
@LXGaming I'm having an issue loading this mod from the command line using Forge's --fml.mods
argument. How is this being loaded exactly, with the absense of a mods.toml file? I'd like to be able to load this using the argument if possible.
MixinBootstrap uses a ITransformationService from ModLauncher which is used in MinecraftForge 1.13+
The way MixinBootstrap gets loaded starts with Forge's ModDirTransformerDiscoverer, This class will scan the mods
directory locating jars containing ITransformationService
services, The jar path is then blacklisted and passed back to ModLauncher so that it can load the jar.
The mods
directory is relative to the --gameDir
argument.
Forge blacklists jars containing ITransformationService
to prevent them being loaded as mods, hence why MixinBootstrap doesn't contain a mods.toml
as it needs to be loaded by ModLauncher.
Potential solutions:
- Copy any jars that don't contain a
mods.toml
to the expectedmods
directory. - Setup a library containing a ITransformerDiscoveryService service and handle locating the jars yourself (You would have to add this library to the java classpath).
- Add MixinBootstrap to the java classpath (Would only apply to MixinBootstrap, May not work for other 'mods').