File tree Expand file tree Collapse file tree
HMCL/src/main/java/org/jackhuang/hmcl/ui/versions Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -288,11 +288,17 @@ public static void cleanGameFiles(Profile profile) {
288288 }
289289
290290 versions .stream ().map (v -> repository .getRunDirectory (v .getId ())).distinct ().forEach (runDir -> {
291+ for (String folderName : uselessFolderNames ) {
292+ Path target = runDir .resolve (folderName );
293+ if (Files .isDirectory (target )) {
294+ unusedFolders .add (target );
295+ }
296+ }
291297 try (var walker = Files .walk (runDir , 1 )) {
292298 unusedFolders .addAll (walker
293299 .filter (it -> {
294300 var name = it .getFileName ().toString ();
295- return (name .startsWith ("natives-" ) || name .endsWith ("-natives" ) || uselessFolderNames . contains ( name ) ) && Files .isDirectory (it );
301+ return (name .startsWith ("natives-" ) || name .endsWith ("-natives" )) && Files .isDirectory (it );
296302 }).toList ());
297303 } catch (IOException ignored ) {
298304 }
You can’t perform that action at this time.
0 commit comments