Files
MinecraftForge/patches/minecraft/net/minecraft/client/gui/screens/OptionsScreen.java.patch
T

18 lines
787 B
Diff

--- a/net/minecraft/client/gui/screens/OptionsScreen.java
+++ b/net/minecraft/client/gui/screens/OptionsScreen.java
@@ -150,6 +_,14 @@
p_283520_.drawCenteredString(this.font, this.title, this.width / 2, 15, 16777215);
}
+ @Override
+ public void onClose() {
+ // We need to consider 2 potential parent screens here:
+ // 1. From the main menu, in which case display the main menu
+ // 2. From the pause menu, in which case exit back to game
+ this.minecraft.setScreen(this.lastScreen instanceof PauseScreen ? null : this.lastScreen);
+ }
+
private Button openScreenButton(Component p_261565_, Supplier<Screen> p_262119_) {
return Button.builder(p_261565_, (p_280808_) -> {
this.minecraft.setScreen(p_262119_.get());