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
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions patches/net/minecraft/client/gui/screens/Screen.java.patch
Original file line number Diff line number Diff line change
Expand Up @@ -50,14 +50,14 @@
}

@Override
@@ -353,6 +_,7 @@
@@ -383,6 +_,7 @@

this.renderBlurredBackground();
this.renderMenuBackground(p_283688_);
+ net.neoforged.neoforge.common.NeoForge.EVENT_BUS.post(new net.neoforged.neoforge.client.event.ScreenEvent.BackgroundRendered(this, p_283688_));
public void renderTransparentBackground(GuiGraphics p_294586_) {
p_294586_.fillGradient(0, 0, this.width, this.height, -1072689136, -804253680);
+ net.neoforged.neoforge.common.NeoForge.EVENT_BUS.post(new net.neoforged.neoforge.client.event.ScreenEvent.BackgroundRendered(this, p_294586_));
}

protected void renderBlurredBackground() {
public boolean isPauseScreen() {
@@ -458,6 +_,10 @@
public void onFilesDrop(List<Path> p_96591_) {
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -228,17 +228,15 @@ public Post(Screen screen, GuiGraphics guiGraphics, int mouseX, int mouseY, floa
}

/**
* Fired directly after the background of the screen is drawn. (Only when the screen calls {@link Screen#renderBackground})
* Can be used for drawing above the background but below the tooltips.
* Fired directly after the transparent background behind the screen is drawn.
* (Only when the screen calls {@link Screen#renderTransparentBackground})
* Can be used for drawing next to the screen and below the tooltips.
*
* <p>This event is not {@linkplain ICancellableEvent cancellable}, and does not {@linkplain HasResult have a result}.</p>
*
* <p>This event is fired on the {@linkplain NeoForge#EVENT_BUS main Forge event bus},
* only on the {@linkplain LogicalSide#CLIENT logical client}.</p>
*
* @deprecated Planned on being removed in 1.21.1 due to extreme maintenance burden to make this event fire consistently for most screens.
*/
@Deprecated(forRemoval = true, since = "21.0")
public static class BackgroundRendered extends ScreenEvent {
private final GuiGraphics guiGraphics;

Expand Down