Skip to content

Allow Panel and Screen Creation to Fail - #156

Open
Vlamonster wants to merge 2 commits into
masterfrom
nullable-panels-and-screens
Open

Allow Panel and Screen Creation to Fail#156
Vlamonster wants to merge 2 commits into
masterfrom
nullable-panels-and-screens

Conversation

@Vlamonster

@Vlamonster Vlamonster commented Jul 30, 2026

Copy link
Copy Markdown
Member

Summary

Change NotNull to Nullable contract for creating panels and screens.
Cancels opening GUI upon a null panel or screen.

Adaptation in gt5u: Adapt to MUI2 getGuiHolder Change- #7613.

Checklist

  • I have tested this PR in DevEnv
  • I have tested this PR in Fullpack
  • This PR is in compliance with the GTNH AI Policy
  • This PR requires another PR in order to merge

@Vlamonster Vlamonster changed the title Allow panel and screen creation to fail Allow Panel and Screen Creation to Fail Jul 30, 2026
@Vlamonster Vlamonster added Bug Fix Fixes a bug. Please link it in the PR if an issue exists for it. Chore Buildscript update, dep update, adaptation to trivial breaking changes, etc. labels Jul 30, 2026
Comment thread src/main/java/com/cleanroommc/modularui/factory/GuiManager.java Outdated
if (panel == null) throw new IllegalStateException("Panel must not be null on Client when Panel was not null on Server!");
WidgetTree.collectSyncValues(syncManager, panel);
ModularScreen screen = factory.createScreen(guiData, panel);
if (screen == null) throw new IllegalStateException("Screen must not be null on Client when Screen was not null on Server!");

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Technically server doesnt have a screen. Its just the panel

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bug Fix Fixes a bug. Please link it in the PR if an issue exists for it. Chore Buildscript update, dep update, adaptation to trivial breaking changes, etc.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants