Class UpdateChecker

java.lang.Object
dev.despical.mazeengine.util.UpdateChecker

public final class UpdateChecker extends Object
Asks SpigotMC for the latest published resource version without blocking the server thread.

The request runs asynchronously and failures are logged only at a fine level, so an unreachable API never affects startup. A newer version is reported to the callback on the server thread; equal, older or unparsable versions are ignored.

  • Method Details

    • check

      public static void check(org.bukkit.plugin.java.JavaPlugin plugin, int resource, Consumer<String> onNewer)
      Calls onNewer on the server thread when the published version is newer than the running one.
      Parameters:
      plugin - the plugin whose version is compared
      resource - the SpigotMC resource identifier
      onNewer - receives the latest published version
    • isNewer

      public static boolean isNewer(String candidate, String current)
      Compares dotted numeric versions; anything unparsable counts as not newer.