From 77c7ebc0d01e1556e9f69cd1268c29d3b0c23573 Mon Sep 17 00:00:00 2001 From: James Seibel Date: Sun, 21 Sep 2025 21:25:57 -0500 Subject: [PATCH] Fix a few UI screens crashing --- .../common/wrappers/gui/MinecraftScreen.java | 5 ++++- .../common/wrappers/gui/updater/ChangelogScreen.java | 6 +++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/common/src/main/java/com/seibel/distanthorizons/common/wrappers/gui/MinecraftScreen.java b/common/src/main/java/com/seibel/distanthorizons/common/wrappers/gui/MinecraftScreen.java index 2efa317c1..ab02fb075 100644 --- a/common/src/main/java/com/seibel/distanthorizons/common/wrappers/gui/MinecraftScreen.java +++ b/common/src/main/java/com/seibel/distanthorizons/common/wrappers/gui/MinecraftScreen.java @@ -78,9 +78,12 @@ public class MinecraftScreen { #if MC_VER < MC_1_20_2 this.renderBackground(matrices); // Render background - #else + #elif MC_VER < MC_1_21_6 this.renderBackground(matrices, mouseX, mouseY, delta); // Render background + #else + // background blur is already being rendered, rendering again causes the game to crash #endif + this.list.render(matrices, mouseX, mouseY, delta); // Renders the items in the render list (currently only used to tint background darker) screen.mouseX = mouseX; diff --git a/common/src/main/java/com/seibel/distanthorizons/common/wrappers/gui/updater/ChangelogScreen.java b/common/src/main/java/com/seibel/distanthorizons/common/wrappers/gui/updater/ChangelogScreen.java index 6e5cb4e3c..1704234eb 100644 --- a/common/src/main/java/com/seibel/distanthorizons/common/wrappers/gui/updater/ChangelogScreen.java +++ b/common/src/main/java/com/seibel/distanthorizons/common/wrappers/gui/updater/ChangelogScreen.java @@ -74,6 +74,7 @@ public class ChangelogScreen extends DhScreen { return; } + try { this.setupChangelog(versionID); @@ -175,9 +176,12 @@ public class ChangelogScreen extends DhScreen { #if MC_VER < MC_1_20_2 this.renderBackground(matrices); // Render background - #else + #elif MC_VER < MC_1_21_6 this.renderBackground(matrices, mouseX, mouseY, delta); // Render background + #else + // background blur is already being rendered, rendering again causes the game to crash #endif + if (!this.usable) { return;