@@ -277,7 +277,7 @@ private CompletableFuture<?> loadMods(ModManager modManager) {
277277 synchronized (ModListPage .this ) {
278278 setLoading (true );
279279 modManager .refreshMods ();
280- return new ArrayList <>( modManager . getMods ());
280+ return modManager . getMods (). stream (). map ( it -> new ModInfoObject ( getContext (), it )). collect ( Collectors . toList ());
281281 }
282282 } catch (IOException e ) {
283283 throw new UncheckedIOException (e );
@@ -286,10 +286,10 @@ private CompletableFuture<?> loadMods(ModManager modManager) {
286286 setLoading (false );
287287 if (exception == null )
288288 try {
289- itemsProperty .setAll (list .stream ().map ( it -> new ModInfoObject ( getContext (), it )). filter (modInfoObject -> {
289+ itemsProperty .setAll (list .stream ().filter (modInfoObject -> {
290290 boolean active = modInfoObject .getModInfo ().isActive ();
291291 return (enabled .isChecked () && active ) || (disabled .isChecked () && !active );
292- }).sorted (). collect (Collectors .toList ()));
292+ }).collect (Collectors .toList ()));
293293 } catch (Throwable e ) {
294294 LOG .log (Level .SEVERE , "Failed to load local mod list" , e );
295295 }
@@ -500,7 +500,7 @@ private void search() {
500500 }
501501 }
502502
503- public static class ModInfoObject implements Comparable < ModInfoObject > {
503+ public static class ModInfoObject {
504504 private final BooleanProperty active ;
505505 private final LocalModFile localModFile ;
506506 private final String title ;
@@ -547,11 +547,6 @@ public ModTranslations.Mod getMod() {
547547 return mod ;
548548 }
549549
550- @ Override
551- public int compareTo (@ NotNull ModInfoObject o ) {
552- return localModFile .getFileName ().toLowerCase ().compareTo (o .localModFile .getFileName ().toLowerCase ());
553- }
554-
555550 public RemoteMod getRemoteMod () {
556551 return remoteMod ;
557552 }
0 commit comments