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 #1077 Fix up ScreenEvent.BackgroundRendered #1500

Open
wants to merge 1 commit into
base: 1.21.x
Choose a base branch
from

Conversation

mezz
Copy link
Contributor

@mezz mezz commented Aug 30, 2024

Context

In #1077 I advocated for removing this event as no longer necessary, but it turns out this event is still needed after all, for a single very specific case.

image

Tooltips and item energy bars both render using RenderType.GUI_OVERLAY which has forced setDepthTestState(NO_DEPTH_TEST).
So the only way to order them correctly is to have the items draw before the tooltip using this event:

image

Solution notes

There is a better place to fire this event so that it doesn't need many patches: right after the transparent background is drawn. Every normal in-game GUI makes the call to draw that transparent background before their own background.

Technically this is a breaking change, but an extremely minor one. Also, the event was pretty broken before anyway.

@neoforged-pr-publishing
Copy link

  • Publish PR to GitHub Packages

@sciwhiz12 sciwhiz12 added bug A bug or error 1.21.1 Targeted at Minecraft 1.21.1 labels Sep 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1.21.1 Targeted at Minecraft 1.21.1 bug A bug or error
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants