Package com.comphenix.protocol.updater
Class Updater
java.lang.Object
com.comphenix.protocol.updater.Updater
- Direct Known Subclasses:
SpigotUpdater
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumGives the dev the result of the update process.static enumAllows the dev to specify the type of update that will be run. -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected booleanprotected org.bukkit.plugin.Pluginstatic final ReportTypeprotected Updater.UpdateResultprotected Threadprotected Updater.UpdateTypeprotected Stringprotected Stringprotected Stringprotected Stringprotected String -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedUpdater(org.bukkit.plugin.Plugin plugin, Updater.UpdateType type, boolean announce) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddListener(Runnable listener) Add a listener to be executed when we have determined if an update is available.static Updatercreate(org.bukkit.plugin.Plugin plugin, int id, File file, Updater.UpdateType type, boolean announce) Get the latest version's file link.Get the latest version's game version.Get the latest version's name.Get the latest version's release type (release, beta, or alpha).abstract StringGet the result of the update process.booleanDetermine if we are already checking for an update.booleanremoveListener(Runnable listener) Remove a listener.booleanabstract voidstart(Updater.UpdateType type) booleanversionCheck(String title) protected voidAs the result of Updater output depends on the thread's completion, it is necessary to wait for the thread to finish before allowing anyone to check the result.
-
Field Details
-
REPORT_CANNOT_UPDATE_PLUGIN
-
plugin
protected org.bukkit.plugin.Plugin plugin -
versionName
-
versionLink
-
versionType
-
versionGameVersion
-
versionFileName
-
type
-
announce
protected boolean announce -
thread
-
result
-
listeners
-
-
Constructor Details
-
Updater
-
-
Method Details
-
create
public static Updater create(org.bukkit.plugin.Plugin plugin, int id, File file, Updater.UpdateType type, boolean announce) -
versionCheck
-
addListener
Add a listener to be executed when we have determined if an update is available.The listener will be executed on the main thread.
- Parameters:
listener- - the listener to add.
-
removeListener
Remove a listener.- Parameters:
listener- - the listener to remove.- Returns:
- TRUE if the listener was removed, FALSE otherwise.
-
getResult
Get the result of the update process. -
getLatestType
Get the latest version's release type (release, beta, or alpha). -
getLatestGameVersion
Get the latest version's game version. -
getLatestName
Get the latest version's name. -
getLatestFileLink
Get the latest version's file link. -
waitForThread
protected void waitForThread()As the result of Updater output depends on the thread's completion, it is necessary to wait for the thread to finish before allowing anyone to check the result. -
isChecking
public boolean isChecking()Determine if we are already checking for an update.- Returns:
- TRUE if we are, FALSE otherwise.
-
start
-
shouldNotify
public boolean shouldNotify() -
getRemoteVersion
-