Skip to content

Commit 54a6db6

Browse files
committed
Ensure an entry is selected when entering the mods screen.
- Initially select top mod entry - Prevents config button click crash * This was a reversion sometime since 1.20
1 parent aa5938a commit 54a6db6

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

src/main/java/com/terraformersmc/modmenu/gui/ModsScreen.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -277,6 +277,10 @@ protected void init() {
277277
this.addDrawableChild(modsFolderButton);
278278
this.addDrawableChild(doneButton);
279279

280+
// Ensure a valid entry is selected
281+
this.updateSelectedEntry(this.modList.getEntry(0));
282+
this.modList.select(this.selected);
283+
280284
this.init = true;
281285
this.keepFilterOptionsShown = true;
282286
}
@@ -534,10 +538,9 @@ public void updateSelectedEntry(ModListEntry entry) {
534538
this.descriptionListWidget.updateSelectedMod(selected.getMod());
535539

536540
if (this.configureButton != null) {
537-
538541
this.configureButton.active = getModHasConfigScreen(modId);
539542
this.configureButton.visible =
540-
selected != null && getModHasConfigScreen(modId) || modScreenErrors.containsKey(modId);
543+
getModHasConfigScreen(modId) || modScreenErrors.containsKey(modId);
541544

542545
if (modScreenErrors.containsKey(modId)) {
543546
Throwable e = modScreenErrors.get(modId);

0 commit comments

Comments
 (0)