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

Undocumented behaviour of ModMenuApi#getModConfigScreenFactory() #724

Open
MrCrayfish opened this issue Apr 30, 2024 · 0 comments
Open

Undocumented behaviour of ModMenuApi#getModConfigScreenFactory() #724

MrCrayfish opened this issue Apr 30, 2024 · 0 comments

Comments

@MrCrayfish
Copy link

MrCrayfish commented Apr 30, 2024

I was brought to attention that ModMenuApi#getModConfigScreenFactory() is able to return null (the factory itself, not the value created by it). This is not mentioned in the method documentation or annotated.

A null check is performed here when retrieving the factory from the map, but is this to allow the mentioned method to return null or is this just a standard null check after getting a value from a map?
https://github.com/TerraformersMC/ModMenu/blob/1.20.3/src/main/java/com/terraformersmc/modmenu/ModMenu.java#L61-L62

The factory is pushed to the map even if it is null.
https://github.com/TerraformersMC/ModMenu/blob/1.20.3/src/main/java/com/terraformersmc/modmenu/ModMenu.java#L80

I am not sure right now if this is intended or is being confused with the return value of ConfigScreenFactory#create.

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