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

fix: use dimension type from constructor instead of calling getDimension #510

Merged
merged 1 commit into from
Apr 9, 2024

Conversation

embeddedt
Copy link
Contributor

We ran into a mod compat issue from a mod overriding getDimension in its own World subclass and returning a value from a field it initialized in the subclass constructor. Since Lithium's inject runs before the subclass constructor, this caused an NPE.

The best solution IMO is to just use the dimension type provided as the constructor argument, rather than retrieving it through getDimension. This changes nothing for vanilla behavior because the default implementation of World#getDimension() returns a field initialized by that argument.

@2No2Name 2No2Name merged commit e2bf990 into CaffeineMC:develop Apr 9, 2024
1 check passed
@embeddedt embeddedt deleted the fix-dim-crash branch April 10, 2024 16:24
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

Successfully merging this pull request may close these issues.

2 participants