-
Notifications
You must be signed in to change notification settings - Fork 0
Version Sources and Comparison
Jeremy Fail edited this page Apr 4, 2026
·
2 revisions
| Constructor | Remote “latest” |
|---|---|
PluginUpdateChecker(JavaPlugin, String githubOwnerRepo) |
GitHub Releases API: tag_name of the first release in the array. Empty array → IOException (“no GitHub release found”). |
PluginUpdateChecker(JavaPlugin, URL plainTextVersionUrl) |
HTTP GET; first non-empty line after trim. |
PluginUpdateChecker(JavaPlugin, RemoteVersionSupplier) |
Your code; may throw IOException. Must not use the Bukkit API (runs on an async thread). |
Built-in HTTP uses HttpURLConnection with the User-Agent and connect timeout you configure on the checker (see Checks, scheduler, and HTTP).
- Read from
plugin.getDescription().getVersion()(trimmed) unless you callsetInstalledVersion(String);nullclears the override.
-
Ordering: Maven-style via
org.apache.maven.artifact.versioning.ComparableVersion(segments and qualifiers, not plain lexicographic string order). - Sanity filter: If the remote string is not strictly newer than installed, the outcome is running latest (avoids false “update” from odd API data).
-
PluginUpdateChecker.isRemoteVersionNewer(String installed, String remote)-trueonly ifremotecompares strictly newer thaninstalled.
Equivalent logic: VersionCompare.isRemoteNewerThanInstalled.