Skip to content

Commit

Permalink
Fix #1077 Fix up ScreenEvent.BackgroundRendered
Browse files Browse the repository at this point in the history
  • Loading branch information
mezz committed Nov 24, 2024
1 parent 16b2d4d commit 2eac586
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 10 deletions.
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

0 comments on commit 2eac586

Please sign in to comment.