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.AccessInfo> accessCache
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 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.