Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master-1.20-lts' into master-1.20
Browse files Browse the repository at this point in the history
  • Loading branch information
rubensworks committed Jun 21, 2024
2 parents f05d717 + d6bba5d commit 14efbc9
Showing 1 changed file with 17 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -113,22 +113,24 @@ public void onTerminalStorageButtons(TerminalStorageTabClientLoadButtonsEvent ev

@SubscribeEvent
public void onTerminalStorageScreenSize(TerminalStorageScreenSizeEvent event) {
try {
boolean isOpen = jeiRuntime.getIngredientListOverlay().isListDisplayed() || ((BookmarkOverlay) jeiRuntime.getBookmarkOverlay()).isListDisplayed();
boolean wasJeiVisiblePrevious = wasJeiVisible;
if (isOpen) {
wasJeiVisible = true;
event.setWidth(event.getWidth() - 180);
} else {
wasJeiVisible = false;
if (jeiRuntime != null) {
try {
boolean isOpen = jeiRuntime.getIngredientListOverlay().isListDisplayed() || ((BookmarkOverlay) jeiRuntime.getBookmarkOverlay()).isListDisplayed();
boolean wasJeiVisiblePrevious = wasJeiVisible;
if (isOpen) {
wasJeiVisible = true;
event.setWidth(event.getWidth() - 180);
} else {
wasJeiVisible = false;
}

// Re-init screen if JEI was just made (in)visible
if (wasJeiVisiblePrevious != wasJeiVisible) {
((ContainerScreenTerminalStorage) Minecraft.getInstance().screen).init();
}
} catch (NoClassDefFoundError | ClassCastException e) {
// Do nothing when we detect some JEI API issues
}

// Re-init screen if JEI was just made (in)visible
if (wasJeiVisiblePrevious != wasJeiVisible) {
((ContainerScreenTerminalStorage) Minecraft.getInstance().screen).init();
}
} catch (NoClassDefFoundError | ClassCastException e) {
// Do nothing when we detect some JEI API issues
}
}

Expand Down

0 comments on commit 14efbc9

Please sign in to comment.