Skip to content

Commit

Permalink
Check if main render target is initialized before resizing it (#1946)
Browse files Browse the repository at this point in the history
  • Loading branch information
jellysquid3 authored Feb 8, 2025
1 parent 840719e commit e8440e1
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion patches/net/minecraft/client/Minecraft.java.patch
Original file line number Diff line number Diff line change
Expand Up @@ -179,14 +179,15 @@
this.deltaTracker.updatePauseState(this.pause);
this.deltaTracker.updateFrozenState(!this.isLevelRunningNormally());
long l = Util.getNanos();
@@ -1351,10 +_,12 @@
@@ -1351,10 +_,13 @@
this.window.setGuiScale((double)i);
if (this.screen != null) {
this.screen.resize(this, this.window.getGuiScaledWidth(), this.window.getGuiScaledHeight());
+ net.neoforged.neoforge.client.ClientHooks.resizeGuiLayers(this, this.window.getGuiScaledWidth(), this.window.getGuiScaledHeight());
}

RenderTarget rendertarget = this.getMainRenderTarget();
+ if (rendertarget != null)
rendertarget.resize(this.window.getWidth(), this.window.getHeight());
+ if (this.gameRenderer != null)
this.gameRenderer.resize(this.window.getWidth(), this.window.getHeight());
Expand Down

0 comments on commit e8440e1

Please sign in to comment.