-
-
Notifications
You must be signed in to change notification settings - Fork 76
Fixed NullPointerException on startup #730
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
base: dev/1.20.4
Are you sure you want to change the base?
Fixed NullPointerException on startup #730
Conversation
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.
The preferred way to fix this would be to rename the commonSetup function to setup and to move it into the constructor at the first place
At this point, the mod list is already initialized
I am currently only at my phone. So I am unsure if the preview works.
I think we can put that to static class init block instead of |
Why not use ModList.get().isLoaded(....) where APAddons.....Loaded is used? |
I wonder if it may has less performance than check a boolean, but I may over thinking it. |
Well ModList.get() just returns its singleton instance; private static ModList INSTANCE so i dont think that this will have any performance impact |
Maybe a bit. But saving that as a variable in a field like we do it currently is nothing harder to do than calling Putting that into a static class init would also be a solution, it just loads them when it is needed. I always think they are ugly, but it's a good solution But we already just use the same method, just renamed it and moved it to the top of the constructor in 1.21 to fix that issue. If there is no particular reason to move to the static init, this should be done for 1.20.4 too. |
PLEASE READ THE GUIDELINES BEFORE MAKING A CONTRIBUTION
What kind of change does this PR introduce? (Bug fix, feature, ...)
Bug Fix
What is the current behavior? (You can also link to an open issue here)
When trying run minecraft 1.20.4 with neoforge and AP installed
is thrown
This is because
APAddons::commonSetup
is called afterRegistration::register
the issue is, that
APAddons.ae2Loaded
has not been initialized so it defaults tofalse
Whenever something checks if a mod is loaded, the ModList will directly be checked
i dont think so :D