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

Close the recipe screen even if parent screen is null #2298

Merged
merged 1 commit into from
Apr 11, 2021

Conversation

deirn
Copy link
Contributor

@deirn deirn commented Apr 3, 2021

When you open the recipe screen when still in world, this.parentScreen is null, making you stuck on the recipe screen with no way out.

@CLAassistant
Copy link

CLAassistant commented Apr 3, 2021

CLA assistant check
All committers have signed the CLA.

@mezz
Copy link
Owner

mezz commented Apr 11, 2021

Thanks for contributing! Can you please explain the issue in more detail? I am not sure how to reproduce the bug this is fixing.

@deirn
Copy link
Contributor Author

deirn commented Apr 11, 2021

So I want to make a thing that shows the recipe/usage for the block you look at. I called IRecipeManager#createFocus while the player in game, making Minecraft#currentScreen == null which makes parentScreen == null.

@mezz
Copy link
Owner

mezz commented Apr 11, 2021

Thanks, that makes sense to me.
We used to close the player's screen in this case, but it caused a loop bug reported here: #2214
I think just setting the GUI to null should be safe here though, I'll check to see if it has any side effects.

@mezz
Copy link
Owner

mezz commented Apr 11, 2021

Looks like it should be fine, I'll merge this as-is.

@mezz mezz merged commit 3cf55c2 into mezz:1.16 Apr 11, 2021
@deirn deirn deleted the null-parent-screen branch April 11, 2021 04:59
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.

None yet

3 participants