-
Notifications
You must be signed in to change notification settings - Fork 0
Developer API
DailyStreak exposes a public API for other plugins to read or modify streak data.
DailyStreakApi api = DailyStreakApiProvider.get();api.getCurrentStreak(player.getUniqueId()).thenAccept(streak -> {
player.sendMessage("Current streak: " + streak);
});All API methods that read or mutate persistent data return a CompletableFuture and are safe to call from the main thread — the plugin handles moving database/storage work off-thread internally. Don't block on the future with .get()/.join() on the main thread; use .thenAccept() or similar to handle the result asynchronously.
If DailyStreak is published to a repository (e.g. JitPack), add it to your pom.xml or build.gradle as a provided/compileOnly dependency, and declare a soft-depend in your plugin.yml:
softdepend: [DailyStreak]Then guard your API usage in case DailyStreak isn't installed:
if (Bukkit.getPluginManager().getPlugin("DailyStreak") != null) {
DailyStreakApi api = DailyStreakApiProvider.get();
// ...
}If you're building against the API and something's unclear or missing, open an issue — API requests from integrators are welcome.