Class SpigotUpdateChecker

java.lang.Object
net.lucypoulton.squirtgun.update.UpdateChecker
net.lucypoulton.squirtgun.update.SpigotUpdateChecker

public class SpigotUpdateChecker extends UpdateChecker
Update checking mechanism for Spigot plugins.
  • 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 against
      pluginId - the numeric spigot resource id
      updateMessage - the message to show in console and to players with the listener permission on join
      listenerPermission - if a player holds this permission and an update is available, they will be sent the update message in chat
  • Method Details

    • checkDataForUpdate

      protected boolean checkDataForUpdate(String input)
      Description copied from class: UpdateChecker
      Check if the result of a request indicates an update is available.
      Specified by:
      checkDataForUpdate in class UpdateChecker
      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.