-
Notifications
You must be signed in to change notification settings - Fork 237
Select jar configuration based on which sides are present #1182
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
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -157,8 +157,16 @@ private synchronized void setupMinecraft(ConfigContext configContext) throws Exc | |
|
|
||
| var jarConfiguration = extension.getMinecraftJarConfiguration().get(); | ||
|
|
||
| if (jarConfiguration == MinecraftJarConfiguration.MERGED && !metadataProvider.getVersionMeta().isVersionOrNewer(Constants.RELEASE_TIME_1_3)) { | ||
| jarConfiguration = MinecraftJarConfiguration.LEGACY_MERGED; | ||
| if (jarConfiguration == MinecraftJarConfiguration.MERGED) { | ||
| // if no configuration is selected by the user, attempt to select one | ||
| // based on the mc version and which sides are present for it | ||
| if (!metadataProvider.getVersionMeta().downloads().containsKey("server")) { | ||
| jarConfiguration = MinecraftJarConfiguration.CLIENT_ONLY; | ||
|
||
| } else if (!metadataProvider.getVersionMeta().downloads().containsKey("client")) { | ||
| jarConfiguration = MinecraftJarConfiguration.SERVER_ONLY; | ||
| } else if (!metadataProvider.getVersionMeta().isVersionOrNewer(Constants.RELEASE_TIME_1_3)) { | ||
| jarConfiguration = MinecraftJarConfiguration.LEGACY_MERGED; | ||
modmuss50 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| } | ||
| } | ||
|
|
||
| // Provide the vanilla mc jars | ||
|
|
||
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 isnt always stricly true, as a user could have requested a merged jar. I know its unlikely and changing this would be a much bigger change. Overall im not sure how much benefit this provides.
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.
How would the user select a merged jar? It's the default and there are API methods only for changing it to client-only or server-only. Regardless, if one side does not exist then the build will fail on the merger configuration anyway.
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.
The user could set the value of LoomGradleExtensionAPI.getMinecraftJarConfiguration(), I think its unlikely so I wouldnt worry too much about it.
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 see, that's a fair point. It would be possible to leave the value empty instead of setting the Convention to merged, that way you'd know if the user selected a specific configuration or not.
I agree it's not a big deal to set this. It's a minor inconvenience but this is also a minor change to alleviate that so I thought it was fair.