Skip to content

Commit

Permalink
Correctly filter out hidden packs from unselected packs in pack selec…
Browse files Browse the repository at this point in the history
…tion screen (#415)
  • Loading branch information
lukebemish authored Dec 23, 2023
1 parent 4196a77 commit aa32f54
Showing 1 changed file with 14 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,11 +1,23 @@
--- a/net/minecraft/client/gui/screens/packs/PackSelectionModel.java
+++ b/net/minecraft/client/gui/screens/packs/PackSelectionModel.java
@@ -31,7 +_,7 @@
@@ -31,9 +_,9 @@
this.onListChanged = p_99909_;
this.iconGetter = p_99910_;
this.repository = p_99911_;
- this.selected = Lists.newArrayList(p_99911_.getSelectedPacks());
+ this.selected = Lists.newArrayList(p_99911_.getSelectedPacks().stream().filter(p -> !p.isHidden()).toList());
Collections.reverse(this.selected);
this.unselected = Lists.newArrayList(p_99911_.getAvailablePacks());
- this.unselected = Lists.newArrayList(p_99911_.getAvailablePacks());
+ this.unselected = Lists.newArrayList(p_99911_.getAvailablePacks().stream().filter(p -> !p.isHidden()).toList());
this.unselected.removeAll(this.selected);
this.output = p_99912_;
}
@@ -59,7 +_,7 @@
this.repository.reload();
this.selected.retainAll(this.repository.getAvailablePacks());
this.unselected.clear();
- this.unselected.addAll(this.repository.getAvailablePacks());
+ this.unselected.addAll(this.repository.getAvailablePacks().stream().filter(p -> !p.isHidden()).toList());
this.unselected.removeAll(this.selected);
}

0 comments on commit aa32f54

Please sign in to comment.