-
Notifications
You must be signed in to change notification settings - Fork 0
Events, Callbacks, and Notifications
Register like any Bukkit event. Fired after each completed check attempt.
| API | Meaning |
|---|---|
getChecker() |
PluginUpdateChecker instance |
isSuccess() |
Supplier/HTTP finished without throwing |
getResult() |
NEW_VERSION_AVAILABLE, RUNNING_LATEST_VERSION, or UNKNOWN
|
getInstalledVersion() |
Version used for comparison |
getLatestVersion() |
Resolved remote string on success; otherwise null
|
getRequestors() |
Immutable list; empty if silent check |
-
setOnSuccess(UpdateSuccessCallback)— main thread after a successful fetch; receives requestors + latest string. -
setOnFailure(Consumer<Throwable>)— main thread after failure; defaultThrowable::printStackTrace. Passingnullinstalls a no-op handler.
One global Listener is registered once per JVM (first checker construction), using that plugin for registerEvents. If that plugin disables first while others still expect join handling, behavior is undefined; prefer a long-lived plugin or document initialization order.
If setNotifyRequestorsOnCheck(true) (default) and the check had requestors:
-
Players: gray/gold/red/green lines; clickable gold bold underlined links (download / paid+free labels, changelog, donate, support) with hover
Link: <url>. -
Console: bordered warning box (
*), plugin name, versions, optionalChatColorprefixes ifsetColoredConsoleOutput(true), “Please update”, download lines (changelog not in the box), support/donate lines.
setNotifyRequestorsOnCheck(false) turns this off (events/callbacks only).
setSuppressUpToDateConsoleMessage(true) hides the console info line when you are already on the latest version (requestor flow).
setNotifyRequestorsWhenUpToDate(false) stops the “running the latest version” chat line for players who requested the check. Join notifications never show that line.
After at least one check has completed (success or failure):
- If
setNotifyOperatorsOnJoin(true)and the player is op, orsetNotifyPermissionOnJoin(String)is set and the player has that permission:- Update available: same style as the player update message.
- Up to date: no message.
- Failure / unknown: short “could not check” style line.