Contents
Class UpdateModule
java.lang.Object
com.hypixel.hytale.server.core.plugin.PluginBase
com.hypixel.hytale.server.core.plugin.JavaPlugin
com.hypixel.hytale.server.core.update.UpdateModule
- All Implemented Interfaces:
CommandOwner
Module responsible for managing server updates.
Features:
- Periodic update checks (configurable interval)
- Console and player notifications when updates are available
- Staged update warnings for direct JAR execution
- Reminder messages for pending staged updates
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordDownload progress information. -
Field Summary
FieldsFields inherited from class PluginBase
METRICS_REGISTRY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanCancels the active download if one is in progress.static UpdateModuleget()Gets the current download progress, or null if no download is active.Gets the latest known version from the last check.booleanChecks if a download is currently in progress.voidCalled after server boot is complete to show post-boot reminder.voidReleases the download lock.voidsetActiveDownload(CompletableFuture<?> download, Thread thread) Sets the active download future for tracking and cancellation.voidSets the latest known version (called after any update check).booleanAttempts to acquire the download lock and start a download.voidupdateDownloadProgress(long downloaded, long total) Updates the download progress.Methods inherited from class JavaPlugin
getClassLoader, getFile, getTypeMethods inherited from class PluginBase
getAssetRegistry, getBasePermission, getChunkStoreRegistry, getClientFeatureRegistry, getCodecRegistry, getCodecRegistry, getCodecRegistry, getCommandRegistry, getDataDirectory, getEntityRegistry, getEntityStoreRegistry, getEventRegistry, getIdentifier, getLogger, getManifest, getName, getState, getTaskRegistry, isDisabled, isEnabled, preLoad
-
Field Details
-
MANIFEST
-
KILL_SWITCH_ENABLED
public static final boolean KILL_SWITCH_ENABLED
-
-
Constructor Details
-
UpdateModule
-
-
Method Details
-
get
-
onServerReady
public void onServerReady()Called after server boot is complete to show post-boot reminder. -
getLatestKnownVersion
Gets the latest known version from the last check. -
setLatestKnownVersion
Sets the latest known version (called after any update check). -
isDownloadInProgress
public boolean isDownloadInProgress()Checks if a download is currently in progress. -
tryAcquireDownloadLock
public boolean tryAcquireDownloadLock()Attempts to acquire the download lock and start a download. This is thread-safe and prevents multiple concurrent downloads.- Returns:
- true if the lock was acquired, false if a download is already in progress
-
setActiveDownload
Sets the active download future for tracking and cancellation. Should be called aftertryAcquireDownloadLock()returns true. -
releaseDownloadLock
public void releaseDownloadLock()Releases the download lock. Must be called when download completes or fails. -
updateDownloadProgress
public void updateDownloadProgress(long downloaded, long total) Updates the download progress. Called from download callbacks. -
getDownloadProgress
Gets the current download progress, or null if no download is active. -
cancelDownload
public boolean cancelDownload()Cancels the active download if one is in progress.- Returns:
- true if a download was cancelled
-