quilt-loader icon indicating copy to clipboard operation
quilt-loader copied to clipboard

Load mods from subfolders

Open reoseah opened this issue 2 years ago • 5 comments

This will allow modpack makers and users to organize their mods however they want, e.g. put optimization mods into their own subfolder like mods/optimizations/...

This is different from https://github.com/QuiltMC/quilt-loader/issues/15 as it just removes current limitation when searching for mods.

Currently Fabric/Quilt loader uses 1 for max depth, I suggest change it to Integer.MAX_VALUE in this line: https://github.com/QuiltMC/quilt-loader/blob/232e1741a3d65e4e384958cb2e18ea37b099eaf2/src/main/java/org/quiltmc/loader/impl/discovery/DirectoryModCandidateFinder.java#L58

reoseah avatar Jul 07 '21 11:07 reoseah

Maybe this could be coupled with the ability to exclude entire folders, either based on the hidden attribute, or based on a prefix dot, like for regular mod jars as well.

nea89o avatar Jul 07 '21 11:07 nea89o

Maybe this could be coupled with the ability to exclude entire folders, either based on the hidden attribute, or based on a prefix dot, like for regular mod jars as well.

Yeah, that makes sense, and hidden folders and folders starting with . can be some unknown shit that perhaps shouldn't be loaded.

That could be achieved by overriding another method in the file visitor:

@Override
public FileVisitResult preVisitDirectory(Path dir, BasicFileAttributes attrs) throws IOException {
	if (dir.getFileName().toString().startsWith(".") || Files.isHidden(dir)) {
		return FileVisitResult.SKIP_SUBTREE;
	}
	return FileVisitResult.CONTINUE;
}

reoseah avatar Jul 07 '21 11:07 reoseah

if the loader is designed similarly to fabric (which looking at the file visitor it looks the mostly unchanged) in grabbing file paths as candidates it might be difficult but it would be a nice feature to search zip files as well as folders. Makes modpacks simple and for solves, non technical users, the mistake I see a lot of sticking a zip in the mods folder. I never looked that far into the fabric loader except to suggest recursive searching or at least 1 extra level which was not a design choice fabric wanted so i dont rlly know how the loader effectively works or how difficult adding zip support would be.

WanderingCat27 avatar Apr 25 '22 13:04 WanderingCat27

Zip support for modpacks is certainly an interesting idea, however it depends quite heavily on what the zip contains. For example downloading a modpack zip from curseforge doesn't actually contain the mods, and instead contains a list of files to download, plus overrides for configs, resourcepacks, and occasionally mods that aren't on curseforge. (However this doesn't apply to all zips - some modpack zips might only contain mod jar files).

Either way zip support is not the topic of this particular issue, and I think you should open a different issue if you want to continue to discuss this.

AlexIIL avatar Apr 25 '22 16:04 AlexIIL

Zip support for modpacks is certainly an interesting idea, however it depends quite heavily on what the zip contains. For example downloading a modpack zip from curseforge doesn't actually contain the mods, and instead contains a list of files to download, plus overrides for configs, resourcepacks, and occasionally mods that aren't on curseforge. (However this doesn't apply to all zips - some modpack zips might only contain mod jar files).

Either way zip support is not the topic of this particular issue, and I think you should open a different issue if you want to continue to discuss this.

i was mainly referring to zips of just mods. i put it here cause i thought it was similar in the concept of how the loader explores the mod folder but realize it is a concept unrelated to sub folders directly ill add a new issue tho cause i would love to see it implemented if possible

WanderingCat27 avatar Apr 25 '22 16:04 WanderingCat27