Package wtf.choco.veinminer.update
Class SpigotMCUpdateChecker
java.lang.Object
wtf.choco.veinminer.update.SpigotMCUpdateChecker
- All Implemented Interfaces:
UpdateChecker
An
UpdateChecker
implementation that queries the SpigotMC API.-
Constructor Summary
ConstructorDescriptionSpigotMCUpdateChecker
(@NotNull JavaPlugin plugin, int pluginId) Construct a newSpigotMCUpdateChecker
. -
Method Summary
Modifier and TypeMethodDescription@NotNull CompletableFuture<UpdateResult>
checkForUpdates
(@NotNull VersionScheme versionScheme) Perform an asynchronous update check.@NotNull Optional<UpdateResult>
Get theresult
of the last update check that was performed.
-
Constructor Details
-
SpigotMCUpdateChecker
Construct a newSpigotMCUpdateChecker
.- Parameters:
plugin
- the plugin instancepluginId
- the id of the plugin (found on the SpigotMC website)
-
-
Method Details
-
getLastUpdateResult
Description copied from interface:UpdateChecker
Get theresult
of the last update check that was performed.- Specified by:
getLastUpdateResult
in interfaceUpdateChecker
- Returns:
- the last update result, or an empty
Optional
if an update check has not yet been performed
-
checkForUpdates
@NotNull public @NotNull CompletableFuture<UpdateResult> checkForUpdates(@NotNull @NotNull VersionScheme versionScheme) Description copied from interface:UpdateChecker
Perform an asynchronous update check.- Specified by:
checkForUpdates
in interfaceUpdateChecker
- Parameters:
versionScheme
- theVersionScheme
to use- Returns:
- a
CompletableFuture
containing theUpdateResult
-