Class UpdaterService

java.lang.Object
io.github.thebusybiscuit.slimefun4.core.services.UpdaterService

public class UpdaterService extends Object
This Class represents our PluginUpdater Service. If enabled, it will automatically connect to https://blob.build/ to check for updates and to download them automatically.
Author:
TheBusyBiscuit
  • Constructor Details

    • UpdaterService

      public UpdaterService(@Nonnull Slimefun plugin, @Nonnull String version, @Nonnull File file)
      This will create a new UpdaterService for the given Slimefun. The File should be the result of the getFile() operation of that Plugin.
      Parameters:
      plugin - The instance of Slimefun
      version - The current version of Slimefun
      file - The File of this Plugin
  • Method Details

    • getBranch

      @Nonnull public SlimefunBranch getBranch()
      This method returns the branch the current build of Slimefun is running on. This can be used to determine whether we are dealing with an official build or a build that was unofficially modified.
      Returns:
      The branch this build of Slimefun is on.
    • getBuildNumber

      public int getBuildNumber()
      This method returns the build number that this is running on (or -1 if unofficial). You should combine the usage with getBranch() in order to properly see if this is a development or stable build number.
      Returns:
      The build number of this Slimefun.
    • getLatestVersion

      public int getLatestVersion()
    • isLatestVersion

      public boolean isLatestVersion()
    • start

      public void start()
      This will start the UpdaterService and check for updates. If it can find an update it will automatically be installed.
    • isEnabled

      public boolean isEnabled()
      This returns whether the PluginUpdater is enabled or not. This includes the Config setting but also whether or not we are running an official or unofficial build.
      Returns:
      Whether the PluginUpdater is enabled
    • disable

      public void disable()
      This method is called when the UpdaterService was disabled.