Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(symbolic/soft link) shared resourcepaks / shaderpacks / other folders #38

Open
1 task done
Neon-44 opened this issue Oct 18, 2022 · 23 comments
Open
1 task done
Labels
enhancement New feature or request

Comments

@Neon-44
Copy link

Neon-44 commented Oct 18, 2022

Role

i play multiple instances on Primslauncher

Suggestion

i want the ability to share folders (mainly resourcepacks and shaderpacks) over multiple instances

Benefit

i won't always have to download / copy all the packs into the new instance (and probably save a few MB)

This suggestion is unique

  • I have searched the issue tracker and did not find an issue describing my suggestion, especially not one that has been rejected.

You may use the editor below to elaborate further.

i imagine it somewhat like this:

./instances/modded-instance-1/resourcepacks gets softlinked to ./shared-folders/shared-group-1/shared-resourcepacks

i already did that on my original PolyMC install, although i didn't go with groups there yet, but instead just one folder for all instances to share. it worked really well in that environment (tested on Fedora Linux and NixOS).

the advantages of groups is, that those who want can make a "all instances group" and the rest can make their own groups, if they need them for some reason. maybe some modpacks need special texture packs you don't want to clog up everything, maybe some other reason.

it could possibly also be used to share servers or even worlds.

@Neon-44 Neon-44 added the enhancement New feature or request label Oct 18, 2022
@JustLetterV
Copy link

There is mod that can do what you are asking for:
https://modrinth.com/mod/shared-resources

@pseudoforceyt
Copy link

pseudoforceyt commented Oct 18, 2022

What if some (or a lot) instances you are using are not fabric or forge?
I would like to see this feature being implemented (if possible)

@Octelly
Copy link

Octelly commented Oct 18, 2022

What if some (or a lot) instances you are using are not fabric or forge? I would like to see this feature being implemented (if possible)

yeah and the mod is 1.16+ if I'm reading it correctly

@JustLetterV
Copy link

I agree, this feature would be really nice to have. I just shared this mod just in case OP needs it :) Also it is only 1.16+ sadly.

@yavko
Copy link

yavko commented Oct 20, 2022

This could be cool to sym link mods from a central directory to save tons of space, which that mod also doesn't support.

@Continous
Copy link

It also makes far more sense to do this from the launcher, as it allows the instance/client to be naive to the folder structure, or the actual location of the files. It also doesn't require a mod. It'd also be useful if something like server instances were added.

@Un1q32
Copy link
Contributor

Un1q32 commented Oct 20, 2022

There is mod that can do what you are asking for: https://modrinth.com/mod/shared-resources

this should be a feature of the launcher, not a mod

@Inconn
Copy link

Inconn commented Nov 6, 2022

I also want this feature built into the launcher since I have some large resource packs that I really don't want to create copies of but I don't want to have to manage the symlinks myself. It also would be cool to have a central mod folder where mods get symlinked into the mods folder to save space if you reuse mods but I think that only having a global resources and shaders packs folder would be good enough since it wouldn't make as much of a difference (for me, at least). Though I don't know how you'd do it on Windows, i'm personally a Linux user.

@Continous
Copy link

Though I don't know how you'd do it on Windows, i'm personally a Linux user.

Symbollic and hardlinks exist on both platforms, and as relevant on most filesystems. Implementing a simple check to see if symbolic links are available can be implemented. The biggest hurdle on Windows is that placing symbolic/hardlinks required administrative access last I used it.

@yavko
Copy link

yavko commented Nov 10, 2022

Though I don't know how you'd do it on Windows, i'm personally a Linux user.

Symbollic and hardlinks exist on both platforms, and as relevant on most filesystems. Implementing a simple check to see if symbolic links are available can be implemented. The biggest hurdle on Windows is that placing symbolic/hardlinks required administrative access last I used it.

You don't need admin for it afaik
EDIT: I think there is even a powershell command for it, but I dont use windows so I can't confirm

@Inconn
Copy link

Inconn commented Nov 10, 2022

From what i've searched you need admin for it on Windows, might test it later on another pc

@yavko
Copy link

yavko commented Nov 10, 2022

Okay from deeper research it is a group permissions that is required for it SeCreateSymbolicLinkPrivilege, proof windows is a legacy OS 👏🏻
EDIT: Actually its been fixed in newer windows versions, IF you have developer mode enabled, but I don't think thats the case anymore either

@Continous
Copy link

Yeah, regardless, since some, albeit niche, filesystems and conditions may make symbolic or hardlinks break, there should be a check if such a feature is implemented.

@Inconn
Copy link

Inconn commented Nov 10, 2022

Perhaps it's possible to tell minecraft to look elsewhere or to look in multiple places for resource packs? I know a mod like that exists.

@Continous
Copy link

Not without a mod or runtime hook. Both which can have adverse effects, and/or be otherwise undesirable. Symlinks/hardlinks are a far more agnostic solution, and avoids any reliance on Minecraft having the capacity. If, for example, certain mods rely on local resources stored in the main minecraft folder, haphazardly redirecting things with a mod may cause issues. A symlink, would allow real/original files to coexist without special consideration.

@Inconn
Copy link

Inconn commented Nov 11, 2022

Yeah, links would be the best choice but considering that most people use Windows there won't be a lot of people to benefit from this feature unless they changed their permissions, which most people probably wouldn't want to do, or ran as administrator, which is obviously not a good idea. I still want this feature but the average person wouldn't be able to use it.

@yavko
Copy link

yavko commented Nov 11, 2022

It isn't a admin only thing anymore, but developer mode has to be enabled as it is built as a new api for non admin usage to be used in dev tools, and that's a one time thing. The best way is to show a popup that this feature requires dev mode if not available on windows, but imo prism launcher should keep priority for modern OSes.

@flowln flowln mentioned this issue Jan 21, 2023
1 task
@Ryex
Copy link
Contributor

Ryex commented Jan 21, 2023

we may be able to take a multiple path method of achieving this.

the ability to symlink files would also be useful for de-duplicating mod files and conserving disk space.

Apple, Linux and other *nix will let us create symbolic links easily in-process

On windows this requires admin access, or did until very recently and even then requires group policy changes; full support of our targeted versions would require admin access.
on the windows OSes we could then delegate to a separate PrismLinkFileDaemon.exe which is run with elevated privilege via ShellExacute and the runas verb. This would require the user accept the UAC prompt and communication with this daemon would have to be via named pipes but it is in theory possible.

if the filesystem in question does not allow symbolic link (ie FAT) it could fall back to a file copy.

@ColonelGerdauf
Copy link
Contributor

An alternative that I can see is some way to have the Minecraft instances look in the shared folder in the first place.

This may sound far fetched, but this is how it worked with the Mojang launcher, at least with shaders.

@Continous
Copy link

An alternative that I can see is some way to have the Minecraft instances look in the shared folder in the first place.

This may sound far fetched, but this is how it worked with the Mojang launcher, at least with shaders.

There's no way to do this without undertaking significant work to create a runtime modifying program, or some virtual filesystem, at which point just doing hard/soft links is better.

@ColonelGerdauf
Copy link
Contributor

I am honestly torn on resource packs, as version distinctions can break the feel of the game, unless there is a system that can automatically filter the correct versions, which is a lot more challenging than it sounds. This might work with the legacy texture packs, but the risk is still there.

But it makes me wonder how the default launcher made it work with a singular 'shaderpack' folder at the root of the userdata.

@Continous
Copy link

I am honestly torn on resource packs, as version distinctions can break the feel of the game, unless there is a system that can automatically filter the correct versions, which is a lot more challenging than it sounds. This might work with the legacy texture packs, but the risk is still there.

But it makes me wonder how the default launcher made it work with a singular 'shaderpack' folder at the root of the userdata.

So a few things here,

First; the only major distinction between older and newer versions is where textures are placed, and maybe the texture names. This is something already ironed out/squared away within minecraft as older pre-atlased texture packs have a different folder, Minecraft automatically informs a user of incorrect resource pack versions, and most mods due the same. As for visual differences, that's irrelevant. Users are expected to manage resource packs on their own, if they choose to use a resource/texture pack from the wrong version that's their perogative.

Second, the default launcher doesn't do anything special with the shaderpack folder. That's Minecraft itself having different file locations hardcoded in for that specific folder.

@Continous
Copy link

Sorry to double up, but given that Prism already distinguished Minecraft versions, it should be easy to determine which folders ought to be considered and which ought not to be. Similarly, there could be simple methods to add/remove individual packs/files instead of slapping whole folders.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

10 participants