-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Introduce system mods to mod loading #8238
Conversation
Core game mods are mods which are required to exist in the environment during mod loading. These may be specially provided mods (for example, the `minecraft` mod), or mods which are vital to the framework which FML is connected to (for example, Forge and the `forge` mod). These core game mods are used as the only existing mods in the mod list if mod sorting or dependency verification fails. This allows later steps in the which use resources from these mod files to work correctly (up to when the error screen is shown and the game exits). Implements and closes MinecraftForge#8049
I see.. good idea.. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not quite sure about passing it all the way in from launch, but otherwise OK.
I was/am unsure if there is a better way to provide the set of core game mod IDs to the mod validator from FMLoader. |
Manifest? We could add a manifest entry to the forge jar listing the "core mods"? |
Also, lets call them something other than "core mods". We have core mods already, and this would just confuse matters. These should be call "system mods" because they're part of ensuring basic system function. |
This ensures these don't get confused with coremods (mods which modify core game code).
I agree with the rename to "system mods", for less confusion with "coremods". For the manifest idea, I've found a prospective solution which involves iterating over the list of However, this does have one big gotcha: the |
Is having minecraft hardcoded as a systemmod a bad thing? Given it's a requirement for basically everything else, it seems like a very small loss of generality... Is FML-System-Mod going to act as a flag? Do we expect many other mods to need this? It requires some very special setup to be able to play in this space, so exposing it generally will come at a very high potential for fuck ups.. |
On further thought, And |
OK, so your idea is to use the MinecraftLocator to locate the "tag". That seems reasonable, agree. |
This prevents the remote possibility of a custom mod locator which extends MinecraftLocator to bypass this check.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay that looks much better
Core game mods are mods which are required to exist in the environment during mod loading. These may be specially provided mods (for example, the `minecraft` mod), or mods which are vital to the framework which FML is connected to (for example, Forge and the `forge` mod). These core game mods are used as the only existing mods in the mod list if mod sorting or dependency verification fails. This allows later steps in the which use resources from these mod files to work correctly (up to when the error screen is shown and the game exits).
This PR implements and closes #8049 by introducing the concept of system mods to mod loading.
System mods are mods which are required to exist in the environment during mod loading. These may be specially provided mods (for example, the
minecraft
mod), or mods which are vital to the framework which FML is connected to (for example, Minecraft Forge and theforge
mod). If any of these configured mod IDs cannot be found during mod loading, an exception is immediately thrown to halt the game.These system mods are used as the only existing mods in the mod list if mod sorting or dependency verification fails. This allows later steps in the which use resources from these mod files to work correctly (up to when the error screen is shown and the game exits).
As an example: in #7993, because the
forge
mod was missing from this list, the forge universal JAR was not included when the Access Transformers subsystem was searching for AT configuration files to load. This caused a JVM error to be thrown when the first field (that was assumed to be transformed by AT at that point) tried to be accessed by Forge code.Implementation notes
The set of mod IDs of system mods are passed in as FML service provider arguments: thecoreGameMods
option (when referenced in the command line:--fml.systemMods
), which takes in comma-separated mod IDs for those core game mods.These are then passed down throughModDiscoverer
intoModSorter
, which does the finding of the core game mods and adding them to thesystemMods
field (previously namedforgeAndMC
). The FML-only project is configured with only theminecraft
mod as the core game mod, while the Forge project is configured with bothminecraft
andforge
as core game mods.The set of mod IDs of system mods are configured from the value of the
FML-System-Mods
manifest entry from firstModFile
whose locator isMinecraftLocator
.