-
Notifications
You must be signed in to change notification settings - Fork 54
Apply SJH updates and remove deprecated members #38
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
Conversation
| ); | ||
| var jarContents = new JarContentsBuilder() | ||
| .paths(path) | ||
| .ignoreRootPackages("assets", "data") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note: this skips scanning the assets and data folders of mods for classes... :)
| JarMetadata metadata = JarMetadata.from(new JarContentsBuilder().paths(path).build()); | ||
| metadata.providers().stream() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This greatly speeds up scanning for providers because we are not computing the packages anymore.
| } | ||
| try (var walk = Files.walk(modsDir, 1)){ | ||
| walk.forEach(ModDirTransformerDiscoverer::visitFile); | ||
| walk.parallel().forEach(ModDirTransformerDiscoverer::visitFile); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Walk in parallel to open file systems in parallel, should save some time too based on ATM9 profiles.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this actually work (i.e. does Files.walk's stream actually support parallelism, or is it a no-op)? Usually I like to collect into a list first and then parallel stream that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Apparently this does not work because of a JDK bug that was only fixed in Java 19: https://bugs.openjdk.org/browse/JDK-8280915. Thanks for noticing...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in 7a0fecd.
|
Tested working with a few mods + a custom no-op |
Depends on McModLauncher/securejarhandler#47.
The
IModFileInfocreation is still quite messy, but that will be for another time. :P