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

Comment about the constructor being the first code run is wrong #78

Open
ChiefArug opened this issue Jul 5, 2024 · 0 comments
Open

Comments

@ChiefArug
Copy link

// The constructor for the mod class is the first code that is run when your mod is loaded.

This is technically wrong because static stuff (the <clinit> method) is run before the constructor. In the MDK that is the MODID, LOGGER and all the DeferredThing fields being filled.
It doesn't change the result much but its still technically wrong 🤓. (also this isn't counting coremodding stuff, but I feel like that can generally be considered a separate part of your mod as sharing anything between them is a major recipe for classloading disaster)

Some parentheses could be added for clarification, like

// The constructor for the mod class is the first code that is run when your mod is loaded (after static blocks and fields are executed)
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

1 participant