File tree Expand file tree Collapse file tree 3 files changed +8
-13
lines changed
src/main/java/com/cleanroommc/modularui Expand file tree Collapse file tree 3 files changed +8
-13
lines changed Original file line number Diff line number Diff line change @@ -79,13 +79,10 @@ public class ClientScreenHandler {
7979
8080 private static IMuiScreen lastMui ;
8181
82- public static boolean guiIsClosing ;
83-
8482 // we need to know the actual gui and not some fake bs some other mod overwrites
8583 @ SubscribeEvent (priority = EventPriority .LOWEST )
8684 public void onGuiOpen (GuiOpenEvent event ) {
8785 GuiScreen newGui = event .getGui ();
88- guiIsClosing = newGui == null ;
8986
9087 defaultContext .reset ();
9188 if (lastMui != null && newGui == null ) {
Original file line number Diff line number Diff line change 11package com .cleanroommc .modularui .value .sync ;
22
33import com .cleanroommc .modularui .ModularUI ;
4- import com .cleanroommc .modularui .network .NetworkUtils ;
5- import com .cleanroommc .modularui .screen .ClientScreenHandler ;
64import com .cleanroommc .modularui .screen .ModularContainer ;
75import com .cleanroommc .modularui .widgets .slot .SlotGroup ;
86import com .cleanroommc .bogosorter .api .ISortingContextBuilder ;
@@ -63,9 +61,7 @@ public void detectAndSendChanges(boolean init) {
6361 }
6462
6563 public void onClose () {
66- if (NetworkUtils .isClient () && ClientScreenHandler .guiIsClosing ) {
67- this .panelSyncManagerMap .values ().forEach (PanelSyncManager ::onClose );
68- }
64+ this .panelSyncManagerMap .values ().forEach (PanelSyncManager ::onClose );
6965 }
7066
7167 public void onOpen () {
Original file line number Diff line number Diff line change 2323import org .jetbrains .annotations .NotNull ;
2424
2525import java .io .IOException ;
26- import java .util .*;
26+ import java .util .ArrayList ;
27+ import java .util .Collection ;
28+ import java .util .List ;
29+ import java .util .Map ;
30+ import java .util .Objects ;
2731import java .util .function .Consumer ;
2832import java .util .function .Supplier ;
2933
@@ -90,10 +94,8 @@ public void onOpen() {
9094 @ ApiStatus .Internal
9195 public void onClose () {
9296 this .closeListener .forEach (listener -> listener .accept (getPlayer ()));
93- for (String name : this .subPanels .keySet ()) {
94- SyncHandler sh = this .getModularSyncManager ().getMainPSM ().syncHandlers .remove (name );
95- this .getModularSyncManager ().getMainPSM ().reverseSyncHandlers .remove (sh );
96- }
97+ // previously panel sync handlers were removed from the main psm, however this problematic if the screen will be reopened at some
98+ // we can just not remove the sync handlers since mui has proper checks for re-registering panels
9799 }
98100
99101 public boolean isInitialised () {
You can’t perform that action at this time.
0 commit comments