Package net.lucypoulton.squirtgun.update
Class PolymartUpdateChecker
java.lang.Object
net.lucypoulton.squirtgun.update.UpdateChecker
net.lucypoulton.squirtgun.update.PolymartUpdateChecker
Update checking mechanism for plugins on Polymart.
-
Constructor Summary
ConstructorsConstructorDescriptionPolymartUpdateChecker(SquirtgunPlugin<?> plugin, int id, 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
-
PolymartUpdateChecker
public PolymartUpdateChecker(SquirtgunPlugin<?> plugin, int id, 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 againstid- the numeric polymart 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.
-