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
ConstructorDescriptionUpdaterService
(Slimefun plugin, String version, File file) This will create a newUpdaterService
for the givenSlimefun
. -
Method Summary
Modifier and TypeMethodDescriptionvoid
disable()
This method is called when theUpdaterService
was disabled.This method returns the branch the current build of Slimefun is running on.int
This method returns the build number that this is running on (or -1 if unofficial).int
boolean
This returns whether thePluginUpdater
is enabled or not.boolean
void
start()
This will start theUpdaterService
and 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 theUpdaterService
and check for updates. If it can find an update it will automatically be installed. -
isEnabled
public boolean isEnabled()This returns whether thePluginUpdater
is enabled or not. This includes theConfig
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 theUpdaterService
was disabled.
-