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

[1.21.3] Mods will have an non-functional config button when ModMenuApi#getModConfigScreenFactory is not implemented. #797

Open
MrCrayfish opened this issue Nov 18, 2024 · 1 comment

Comments

@MrCrayfish
Copy link

MrCrayfish commented Nov 18, 2024

In my mod Configured, I only provide config screens for other mods using ModMenuApi#getProvidedConfigScreenFactories, I do not provide one to the mod itself. However, as of 4fd1eb7 and 39f0fcf, ModMenu will now believe that Configured itself has a config and will show a config button that is non-functional when clicked. My implementation of ModMenuApi#getProvidedConfigScreenFactories has also explicitly ensured that a config screen is not provided by itself.

Solution, default implementation of getModConfigScreenFactory should return null instead of an empty factory, then check for null before putting into ModMenu#configScreenFactories map. I am not sure what implications this will have changing the default implementation, but I don't see another way to detect if a mod has a config screen without an expensive to ConfigScreenFactory#create.

@MrCrayfish MrCrayfish changed the title [1,21.3] Mods will have an non-functional config button when ModMenuApi#getModConfigScreenFactory is not implemented. [1.21.3] Mods will have an non-functional config button when ModMenuApi#getModConfigScreenFactory is not implemented. Nov 18, 2024
@MrCrayfish
Copy link
Author

As a temporary solution, I've implemented getModConfigScreenFactory to return null instead of screen -> null.

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