Skip to content

Add support for downloading latest Modrinth version#153

Open
spartacus04 wants to merge 2 commits into
jpenilla:masterfrom
spartacus04:master
Open

Add support for downloading latest Modrinth version#153
spartacus04 wants to merge 2 commits into
jpenilla:masterfrom
spartacus04:master

Conversation

@spartacus04

Copy link
Copy Markdown

This pull request adds support for downloading the latest available version of a plugin from Modrinth when no specific version is provided. It introduces new APIs and logic to handle this use case, and updates the relevant classes to make the plugin version optional.

Modrinth plugin download improvements:

  • Added a new modrinth(id: String) function in DownloadPluginsSpec and corresponding add(id: String) method in the ModrinthApi interface, allowing users to specify only the plugin ID to download the latest version. [1] [2]
  • Implemented the new add(id: String) method in ModrinthApiImpl, creating a ModrinthApiDownload job with only the plugin ID set.

Version handling changes:

  • Made the version property in ModrinthApiDownload optional, updating its annotations and string representation to reflect when the latest version is used.
  • Updated equality and hash code logic in ModrinthApiDownload to handle the optional version property correctly.

Download resolution logic:

  • Modified PluginDownloadServiceImpl to resolve the latest version from the Modrinth API if no version is specified, fetching the version list and selecting the newest entry. Also added a supporting data class for version list entries. [1] [2]

Other technical adjustments:

  • Added the @Optional annotation import for Gradle tasks.

This was quick and dirty, I literally vibe coded this because I didn't really have time in my hands. If you need a more "human" patch lmk I'll make sure to do that

Copilot AI and others added 2 commits April 21, 2026 22:14
… is specified

Agent-Logs-Url: https://github.com/spartacus04/run-task/sessions/9cb4cf90-352d-4381-9473-7667fc141dcd

Co-authored-by: spartacus04 <52862005+spartacus04@users.noreply.github.com>
…latest-version

Add Modrinth latest version download support
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants