Mod Menu

Mod Menu

36M Downloads

Undocumented behaviour of `ModMenuApi#getModConfigScreenFactory()`

MrCrayfish opened this issue ยท 0 comments

commented

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.