Class UpdaterService
java.lang.Object
io.github.thebusybiscuit.slimefun4.core.services.UpdaterService
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 Summary
ConstructorsConstructorDescriptionUpdaterService(Slimefun plugin, String version, File file) This will create a newUpdaterServicefor the givenSlimefun. -
Method Summary
Modifier and TypeMethodDescriptionvoiddisable()This method is called when theUpdaterServicewas disabled.This method returns the branch the current build of Slimefun is running on.intThis method returns the build number that this is running on (or -1 if unofficial).intbooleanThis returns whether thePluginUpdateris enabled or not.booleanvoidstart()This will start theUpdaterServiceand check for updates.
-
Constructor Details
-
Method Details
-
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 withgetBranch()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 theUpdaterServiceand check for updates. If it can find an update it will automatically be installed. -
isEnabled
public boolean isEnabled()This returns whether thePluginUpdateris enabled or not. This includes theConfigsetting but also whether or not we are running an official or unofficial build.- Returns:
- Whether the
PluginUpdateris enabled
-
disable
public void disable()This method is called when theUpdaterServicewas disabled.
-