Class UpdateManager

java.lang.Object
com.ultikits.ultitools.manager.UpdateManager

@Internal public class UpdateManager extends Object
Manages version checking and update notifications for UltiTools-API and modules. Checks once at startup, stores results for later querying by commands and listeners.
管理UltiTools-API和模块的版本检查和更新通知。 在启动时检查一次,存储结果供命令和监听器查询。
Since:
6.2.0
  • Field Details

    • logger

      private final Logger logger
    • frameworkUpdate

      private volatile UpdateInfo frameworkUpdate
    • moduleUpdates

      private final Map<String,UpdateInfo> moduleUpdates
    • notifiedPlayers

      private final Set<UUID> notifiedPlayers
    • checkComplete

      private volatile boolean checkComplete
  • Constructor Details

    • UpdateManager

      public UpdateManager(Logger logger)
  • Method Details

    • checkUpdatesSync

      public void checkUpdatesSync()
      Run update checks synchronously. Called from async context (BukkitRunnable).
      同步运行更新检查。从异步上下文(BukkitRunnable)调用。
    • checkFrameworkUpdate

      private void checkFrameworkUpdate()
    • checkModuleUpdates

      private void checkModuleUpdates()
    • logResults

      private void logResults()
    • hasAnyUpdates

      public boolean hasAnyUpdates()
      Check if any updates (framework or modules) are available.
      检查是否有任何更新(框架或模块)可用。
      Returns:
      true if any updates are available
      如果有任何更新可用则返回true
    • isPlayerNotified

      public boolean isPlayerNotified(UUID uuid)
      Check if a player has already been notified about available updates.
      检查玩家是否已被通知有可用更新。
      Parameters:
      uuid - the player's UUID
      玩家的UUID
      Returns:
      true if the player has been notified
      如果玩家已被通知则返回true
    • markPlayerNotified

      public void markPlayerNotified(UUID uuid)
      Mark a player as having been notified about available updates.
      标记玩家已被通知有可用更新。
      Parameters:
      uuid - the player's UUID
      玩家的UUID