-
Notifications
You must be signed in to change notification settings - Fork 33
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
FMLConstructModEvent
does not provide optional mod constructor arguments
#122
Comments
We're considering removal of this event (or at least, we did). Can you explain your use-case for this? |
|
We should have a public getter for the ModContainer IMO. You can grab it from ModLoadingContext right now but it's not the cleanest. |
What do you actually get from using the event? I might be missing something, but you still have to have the mod class? |
Mod setup during construction in multiple places that are not bound to the |
I hate the current way of client-only setup too, but I'd rather allow split mod-classes for that purpose :P |
For the setup I linked above I just really like that the client setup can be fully separate from common, just like Fabric, where there is And if the goal is to at some point only provide a single method for mod construction I'd honestly rather axe the constructor instead of |
Well, the original report is still valid. There remains a disparity between the Besides that the documentation issue regarding optional arguments remains a concern especially for new modders and should be addressed. And it still seems to me that |
Yes, but new modders will even less likely use |
Since all other mod loading stages are triggered via events such as But there isn't really an issue here, now that |
Another thing that just came to mind (maybe worth a separate issue): On Fabric client mod initialization is always guaranteed to happen after common mod initialization. This is very useful so that the client part can rely on common stuff to already be available. |
Those kinds of heuristics are very confusing, I would rather have a priority/ordering field in the mod annotation (which would guarantee serial ordering between entrypoints of the same mod). For ordering after the entrypoint of another mod, you need to use the ordering field in the dependency declaration. |
The side-specific mod constructor should logically come after the common one. No need for more confusing options. |
A bit off topic, but please write an issue on the docs repo when there are documentation issues. I can't address things I can't see or remember, and all it does is leave it incorrect. The docs does mention the optional arguments, but if you believe it is insufficient, let me know and I can update them properly: https://docs.neoforged.net/docs/gettingstarted/modfiles#javafml-and-mod |
Yeah I'd agree with that. Someone had a very odd use-case for wanting to run client before common, but that seems very odd. |
This should be resolved once #145 makes it into a NeoForge release. |
Great, thanks! And coming back to the original issue regarding |
I came across another feature of Maybe there could be an option in |
Which non-synchronized collections do you want to access that early? Most are probably not initialized, right? |
Neo allows for some optional arguments (
IEventBus
,ModContainer
,FMLModContainer
,Dist
) to be passed to the constructor of a mod main class.Initializing a mod via
FMLConstructModEvent
has long been an alternative to the constructor setup.It would be great to be able to access those optional arguments from the event as well, especially
ModContainer
, which the event already has a package-private getter for (ModLifecycleEvent
to be precise).The text was updated successfully, but these errors were encountered: