Package net.lucypoulton.squirtgun.update
Class SpigotUpdateChecker
java.lang.Object
net.lucypoulton.squirtgun.update.UpdateChecker
net.lucypoulton.squirtgun.update.SpigotUpdateChecker
Update checking mechanism for Spigot plugins.
-
Constructor Summary
ConstructorsConstructorDescriptionSpigotUpdateChecker(SquirtgunPlugin<?> plugin, int pluginId, net.kyori.adventure.text.Component updateMessage, String listenerPermission)Creates a new update checker, and schedule update checking every 3 hours. -
Method Summary
Modifier and TypeMethodDescriptionprotected booleancheckDataForUpdate(String input)Check if the result of a request indicates an update is available.Methods inherited from class net.lucypoulton.squirtgun.update.UpdateChecker
checkDataForUpdate, checkForUpdate, getListenerPermission, getPlugin, getUpdateMessage
-
Constructor Details
-
SpigotUpdateChecker
public SpigotUpdateChecker(SquirtgunPlugin<?> plugin, int pluginId, net.kyori.adventure.text.Component updateMessage, String listenerPermission)Creates a new update checker, and schedule update checking every 3 hours.- Parameters:
plugin- the plugin to check againstpluginId- the numeric spigot resource idupdateMessage- the message to show in console and to players with the listener permission on joinlistenerPermission- if a player holds this permission and an update is available, they will be sent the update message in chat
-
-
Method Details
-
checkDataForUpdate
Description copied from class:UpdateCheckerCheck if the result of a request indicates an update is available.- Specified by:
checkDataForUpdatein classUpdateChecker- Parameters:
input- the string result of a HTTP GET request from the URL provided to the constructor- Returns:
- whether the data provided shows an update available. In the event of an error, a warning should be printed to the console and this should return false.
-