Add mutable filesystem overlays - #478
Open
AlexIIL wants to merge 11 commits into
Open
Conversation
… rather than byte[] based.
…ing-in for modifiable file systems. Also add support for modifiable overlays.
…m now, and I'd rather not clutter the main package with more in the future.
…ntable folders aren't implemented yet, which is needed to make that feature work in a development environment).
…d_features) to the mod spec itself though.
AlexIIL
force-pushed
the
mutable-fs-overlay
branch
from
September 3, 2025 00:50
fcb3554 to
624b5b0
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This allows mods to add new files to their own filesystem via a separate "overlay" filesystem.
This allows mods to dynamically generate resources that will be automatically picked up by fabric-api or QSL's resource loading system, and they can be used by minecraft. This is somewhat similar to mods like ARRP, and QSL's InMemoryPack, except this is independent to the resource loader (and minecraft version).
Adding
.classfiles in this way doesn't work, as quilt-loader has optimizations in place to make searching for classes faster. I don't expect this to be a major problem since mods can already define new classes with their own class loader.A related new feature this adds to all quilt extended filesystems is dynamic files - these are defined as a
Supplier<byte[]>, and generate the file contents every time they are accessed.Mods must opt-in to this feature at the moment, by adding this to their
quilt_loaderblock inside theirquilt.mod.jsonfile:The file system overlay can be accessed via
ModContainer.getMutableFileOverlay(), which throws anUnsupportedOperationExceptionif the mod hasn't requested the feature. Attempting to modify the mod viaModContainer.rootPath()will not work.I originally wanted to support modifying the mod's entire filesystem, which would allow removing files and folders rather than just adding them. Unfortunately this would likely require mounting folders inside of an
ExtendedFileSystem(to allow mods to reload resources inside a development environment) but this is a lot harder to implement than I first thought, so I'll leave that until later.This also needs to be actually defined in the
quilt.mod.jsonspec.