From 091ce4c72c123f43f317c097818ace15f3a085fa Mon Sep 17 00:00:00 2001 From: DeDiamondPro <67508414+DeDiamondPro@users.noreply.github.com> Date: Wed, 10 Aug 2022 10:15:01 +0200 Subject: Profile command (#88) * e * omg finish profile shit * api and fix 1.12.2 preprocess * fix class names --- src/main/java/cc/polyfrost/oneconfig/gui/OneConfigGui.java | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) (limited to 'src/main/java/cc/polyfrost/oneconfig/gui') diff --git a/src/main/java/cc/polyfrost/oneconfig/gui/OneConfigGui.java b/src/main/java/cc/polyfrost/oneconfig/gui/OneConfigGui.java index 429de09..dd802b5 100644 --- a/src/main/java/cc/polyfrost/oneconfig/gui/OneConfigGui.java +++ b/src/main/java/cc/polyfrost/oneconfig/gui/OneConfigGui.java @@ -58,7 +58,6 @@ import java.util.ArrayList; public class OneConfigGui extends UScreen implements GuiPause { public static OneConfigGui INSTANCE; - public static OneConfigGui instanceToRestore = null; private final SideBar sideBar = new SideBar(); private final TextInputField textInputField = new TextInputField(248, 40, "Search...", false, false, SVGs.MAGNIFYING_GLASS_BOLD); private final ArrayList previousPages = new ArrayList<>(); @@ -75,21 +74,15 @@ public class OneConfigGui extends UScreen implements GuiPause { public OneConfigGui() { INSTANCE = this; - instanceToRestore = null; } public OneConfigGui(Page page) { INSTANCE = this; - instanceToRestore = null; currentPage = page; } public static OneConfigGui create() { - try { - return instanceToRestore == null ? new OneConfigGui() : instanceToRestore; - } finally { - if (instanceToRestore != null) INSTANCE = instanceToRestore; - } + return INSTANCE == null ? new OneConfigGui() : INSTANCE; } @Override @@ -303,8 +296,6 @@ public class OneConfigGui extends UScreen implements GuiPause { @Override public void onScreenClose() { currentPage.finishUpAndClose(); - instanceToRestore = this; - INSTANCE = null; super.onScreenClose(); } -- cgit