File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
HMCLCore/src/main/java/org/jackhuang/hmcl/mod Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change 2626import org .jackhuang .hmcl .util .io .CompressingUtils ;
2727import org .jackhuang .hmcl .util .io .FileUtils ;
2828import org .jackhuang .hmcl .util .tree .ZipFileTree ;
29- import org .jackhuang .hmcl .util .versioning .VersionNumber ;
3029import org .jetbrains .annotations .Unmodifiable ;
3130
3231import java .io .IOException ;
@@ -177,11 +176,13 @@ public void refreshMods() throws IOException {
177176
178177 analyzer = LibraryAnalyzer .analyze (getRepository ().getResolvedPreservingPatchesVersion (id ), null );
179178
179+ boolean supportSubfolders = analyzer .has (LibraryAnalyzer .LibraryType .FORGE )
180+ || analyzer .has (LibraryAnalyzer .LibraryType .QUILT );
181+
180182 if (Files .isDirectory (getModsDirectory ())) {
181183 try (DirectoryStream <Path > modsDirectoryStream = Files .newDirectoryStream (getModsDirectory ())) {
182184 for (Path subitem : modsDirectoryStream ) {
183- if (Files .isDirectory (subitem ) && VersionNumber .isIntVersionNumber (FileUtils .getName (subitem ))) {
184- // If the folder name is game version, forge will search mod in this subdirectory
185+ if (supportSubfolders && Files .isDirectory (subitem )) {
185186 try (DirectoryStream <Path > subitemDirectoryStream = Files .newDirectoryStream (subitem )) {
186187 for (Path subsubitem : subitemDirectoryStream ) {
187188 addModInfo (subsubitem );
You can’t perform that action at this time.
0 commit comments