-
Notifications
You must be signed in to change notification settings - Fork 33
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
Add support for locating mod sources with services from the classpath. #93
Conversation
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 change seems fine as-is. Maybe we should consider extracting the parsing of MOD_CLASSES to a common location - I believe there's an exact duplicate of this logic in MinecraftLocator as well as one or two other places.
loader/src/main/java/net/neoforged/fml/loading/ClasspathTransformerDiscoverer.java
Outdated
Show resolved
Hide resolved
loader/src/main/java/net/neoforged/fml/loading/ClasspathTransformerDiscoverer.java
Show resolved
Hide resolved
Handle MOD_CLASSES exclusions
…discovery' into feature/service-layer-classpath-discovery
loader/src/main/java/net/neoforged/fml/loading/ClasspathTransformerDiscoverer.java
Outdated
Show resolved
Hide resolved
loader/src/main/java/net/neoforged/fml/loading/TransformerDiscovererUtils.java
Outdated
Show resolved
Hide resolved
return metadata.providers().stream() | ||
.map(SecureJar.Provider::serviceName) | ||
.anyMatch(TransformerDiscovererConstants.SERVICES::contains); | ||
return TransformerDiscovererConstants.shouldLoadInServiceLayer(path); |
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.
Now that we're delegating to this method, is shouldLoadInServiceLayer
a good name for this method? Would something like isValidServiceLayerJar
be a better name?
(I would have put this comment on the declaration of the method a few lines above, but it wasn't changed so I couldn't)
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.
I think it's fine like this. Find a synonymous name doesn't make the method clearer.
loader/src/main/java/net/neoforged/fml/loading/moddiscovery/MinecraftLocator.java
Outdated
Show resolved
Hide resolved
Last commit published: 8e92bdc964368f4cf771d9a44099929d071bc910. PR PublishingThe artifacts published by this PR:
Repository DeclarationIn order to use the artifacts published by the PR, add the following repository to your buildscript: repositories {
maven {
name 'Maven for PR #93' // https://github.com/neoforged/FancyModLoader/pull/93
url 'https://prmaven.neoforged.net/FancyModLoader/pr93'
content {
includeModule('net.neoforged.fancymodloader', 'spi')
includeModule('net.neoforged.fancymodloader', 'earlydisplay')
includeModule('net.neoforged.fancymodloader', 'loader')
}
}
} |
This allows a SERVICE-layer source set or jar to be loaded from the classpath in userdev if it is part of the MOD_CLASSES.