MinecraftForge / FML

(Archive Only: Merged into Forge proper) The Forge Mod Loader - an opensource replacement mod loader for minecraft
Other
432 stars 201 forks source link

Detect all mods at the same time #645

Closed mattmess1221 closed 9 years ago

mattmess1221 commented 9 years ago

Instead of doing it one folder at a time, do it all at once just like coremods are. Fixes extra mods being added twice

LexManos commented 9 years ago

Why are they being found twice? Are you adding mods that are in the search path to the explicit extra list of mods.... Why?

mattmess1221 commented 9 years ago

Right now, FML is including the extra mods when it searches the mods directory, both mods and mods/1.7.10.That's practically the same as having the same mod in both folders. It caused the mods to be discovered twice, which causes a crash.

The way coremods handled this was by searching everything at the same time (mods, mods/1.7.10, extras). This won't work for regular mods because each folder is done separately.

This fix makes it so the extra mods are done separately from the dir mods.

mattmess1221 commented 9 years ago

And by extra mods, I mean the ones added using launch arguments.

cpw commented 9 years ago

From the mod list? Or the mods argument?

LexManos commented 9 years ago

The better way for this would be to change findModDirMods to take multiple directories as an argument, aggregate all the files + additionals, and then parse them all once. This way the full potential list is sorted correctly. But yes, I see the issue is that findModDirMods is called twice both adding the additionals.

mattmess1221 commented 9 years ago

@cpw It shouldn't matter, they all get put into the additionalMods.

@LexManos So what's the course of action? Keep how it is or change it to what you suggest?

AbrarSyed commented 9 years ago

Only the best code is pulled. Change it of course.

cpw commented 9 years ago

The version dir is a legacy from another time. I'll fix it properly..