From 5ac4270c179076b4aba6bf106e6c53aea720a352 Mon Sep 17 00:00:00 2001 From: Light_Quanta Date: Thu, 27 Feb 2025 16:10:36 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=8D=E5=86=8D=E5=BC=BA=E5=88=B6=E5=8B=BE?= =?UTF-8?q?=E9=80=89=E4=B8=8D=E5=86=8D=E6=98=BE=E7=A4=BA=E8=AD=A6=E5=91=8A?= =?UTF-8?q?=E5=A4=8D=E9=80=89=E6=A1=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../screens/modsell/ModSellWarningScreen.java | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/src/main/java/com/atsuishio/superbwarfare/client/screens/modsell/ModSellWarningScreen.java b/src/main/java/com/atsuishio/superbwarfare/client/screens/modsell/ModSellWarningScreen.java index ba3e8216a..977c65d86 100644 --- a/src/main/java/com/atsuishio/superbwarfare/client/screens/modsell/ModSellWarningScreen.java +++ b/src/main/java/com/atsuishio/superbwarfare/client/screens/modsell/ModSellWarningScreen.java @@ -63,7 +63,6 @@ public class ModSellWarningScreen extends WarningScreen { } private final Screen lastScreen; - private AbstractButton proceedButton; public ModSellWarningScreen(Screen lastScreen) { super( @@ -77,8 +76,8 @@ public class ModSellWarningScreen extends WarningScreen { @Override protected void initButtons(int pYOffset) { - this.proceedButton = this.createProceedButton(pYOffset); - this.addRenderableWidget(this.proceedButton); + AbstractButton proceedButton = this.createProceedButton(pYOffset); + this.addRenderableWidget(proceedButton); this.addRenderableWidget( Button.builder(CommonComponents.GUI_BACK, button -> Minecraft.getInstance().setScreen(this.lastScreen)) @@ -88,21 +87,13 @@ public class ModSellWarningScreen extends WarningScreen { } private AbstractButton createProceedButton(int pYOffset) { - var proceedButton = Button.builder(CommonComponents.GUI_PROCEED, button -> { + return Button.builder(CommonComponents.GUI_PROCEED, button -> { if (this.stopShowing != null && this.stopShowing.selected()) { ModSellWarningConfig.ENVIRONMENT_CHECKSUM.set(ENVIRONMENT_CHECKSUM); ModSellWarningConfig.ENVIRONMENT_CHECKSUM.save(); } Minecraft.getInstance().setScreen(new JoinMultiplayerScreen(this.lastScreen)); }).bounds(this.width / 2 - 155, 100 + pYOffset, 150, 20).build(); - proceedButton.active = false; - return proceedButton; - } - - @Override - public void tick() { - super.tick(); - this.proceedButton.active = this.stopShowing != null && this.stopShowing.selected(); } @SubscribeEvent(priority = EventPriority.HIGH)