-
Notifications
You must be signed in to change notification settings - Fork 157
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 custom update checking logic #679
Conversation
While initially I didn't want to support this so that everyone has the same and trustworthy update-checking experience, I decided that I will merge this. I'm a little unsure about the option for there not to be a link available though. It seems like if it knows there's an update available it should tell you how to get it, right? |
I think the 'Download link not available' text is a bit odd. If no download link continues to be supported in the API, I think it would make sense to provide a duplicate homepage link if one is available or simply not display the text if the mod does not define a homepage. |
Sure, no problem, I'll change that. |
src/main/java/com/terraformersmc/modmenu/util/UpdateCheckerUtil.java
Outdated
Show resolved
Hide resolved
I think I'm going to merge this into 1.20.3+ since it doesn't seem like 1.20.2 is a super widely used version at this point (at least, 1.20.1 and 1.19.2 are way more used) |
Rebased onto 1.20.3 on a different branch, PR here: #708 |
This PR adds the ability for mods to add their own update checking logic.
Please let me know if you want anything changed.
I hope you consider merging this PR, because it would help modders add their own update checking logic, without needing to implementing their own GUI or notifications.
This would also help with compatibility across different mods having custom update checking logic.
The PR also allows for ModMenu to easily add more ways of checking for updates other than Modrinth.
Usage
In your
ModMenuApi
, implement the methodgetUpdateChecker
:If this method returns
null
or is not implemented, ModMenu will work as always, checking updates using Modrinths API.This custom update logic also still respects the
disable_update_checker
config option.Implement your update checker:
The
UpdateInfo
interface contains the information about available updates.Screenshots
Here are some example screenshots:
Custom text but no download link provided
Custom text and download link provided
Download link provided, but no custom text provided
No custom text and no download link provided