NightbreakContentManager

Utility class for managing Nightbreak content downloads and access checks. Provides async operations and caching for efficient content management.

Constructors

Link copied to clipboard

Properties

Link copied to clipboard
public final static Map<String, NightbreakAccount.VersionInfo> versionCache

Functions

Link copied to clipboard
public static void checkAccessAsync(String slug, Consumer<NightbreakAccount.AccessInfo> callback)
Checks access for a content slug asynchronously.
public static void checkAccessAsync(JavaPlugin ownerPlugin, String slug, Consumer<NightbreakAccount.AccessInfo> callback)
Link copied to clipboard
public static void clearCache()
Clears all caches.
Link copied to clipboard
public static void downloadAsync(String slug, File destinationFolder, Player player, Consumer<Boolean> onComplete)
Downloads content asynchronously with progress updates.
public static void downloadAsync(JavaPlugin ownerPlugin, String slug, File destinationFolder, Player player, Consumer<Boolean> onComplete)
Link copied to clipboard
public static Map<String, NightbreakAccount.AccessInfo> getAccessCache()
Link copied to clipboard
public static Map<String, NightbreakAccount.VersionInfo> getVersionCache()
Link copied to clipboard
public static boolean isCacheStale()
Checks if the cache is stale and needs refreshing.
Link copied to clipboard
public static boolean isComingSoon(NightbreakManagedContent content)
True when the setup menu shows a package as coming soon: it is not released yet and this server has not downloaded it.
Link copied to clipboard
public static boolean isKnownUnpublished(String slug)
True when the published Nightbreak catalog is loaded and does not list this slug: a plugin already offers the package, but it has not been released yet.
Link copied to clipboard
public static boolean isUnreleased(NightbreakManagedContent content)
True when a package is not released yet: its plugin marks it coming soon, or the catalog does not list it.
Link copied to clipboard
public static void refreshVersionCache()
Refreshes the version cache by fetching all versions from Nightbreak.
public static void refreshVersionCache(JavaPlugin ownerPlugin)
Link copied to clipboard
public static void showAccessLinks(Player player, NightbreakAccount.AccessInfo accessInfo)
Shows access purchase links to a player.
Link copied to clipboard
public static void shutdown()
Shuts down the manager and clears caches.