From a6553885824725e45cd7e6f0e28e048cc907aeb0 Mon Sep 17 00:00:00 2001 From: srnyx <25808801+srnyx@users.noreply.github.com> Date: Sun, 27 Oct 2024 15:03:27 -0400 Subject: [PATCH] Add `annoying_api_version` to bStats Added `AnnoyingPlugin#ANNOYING_API_VERSION` for this --- build.gradle.kts | 3 ++- src/main/java/xyz/srnyx/annoyingapi/AnnoyingPlugin.java | 4 ++++ src/main/java/xyz/srnyx/annoyingapi/AnnoyingStats.java | 1 + 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/build.gradle.kts b/build.gradle.kts index f1e6bc1..74c65d9 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -12,7 +12,8 @@ plugins { id("com.gradleup.shadow") version "8.3.3" } -setupMC("xyz.srnyx", "5.1.2", "General purpose API with tons of features") +// Don't forget to change AnnoyingPlugin#ANNOYING_API_VERSION when updating +setupMC("xyz.srnyx", "5.1.2", "General purpose API with tons of features", replacementFiles = setOf("plugin.yml", "AnnoyingStats.class")) spigotAPI("1.8.8") // Dependencies diff --git a/src/main/java/xyz/srnyx/annoyingapi/AnnoyingPlugin.java b/src/main/java/xyz/srnyx/annoyingapi/AnnoyingPlugin.java index 1b01394..677caff 100644 --- a/src/main/java/xyz/srnyx/annoyingapi/AnnoyingPlugin.java +++ b/src/main/java/xyz/srnyx/annoyingapi/AnnoyingPlugin.java @@ -65,6 +65,10 @@ public void log(@NotNull LogRecord logRecord) { super.log(logRecord); } }; + /** + * The version of the Annoying API the plugin is using + */ + @NotNull public static final SemanticVersion ANNOYING_API_VERSION = new SemanticVersion(5, 1, 2); /** * The Minecraft version the server is running */ diff --git a/src/main/java/xyz/srnyx/annoyingapi/AnnoyingStats.java b/src/main/java/xyz/srnyx/annoyingapi/AnnoyingStats.java index 90eafc0..2913630 100644 --- a/src/main/java/xyz/srnyx/annoyingapi/AnnoyingStats.java +++ b/src/main/java/xyz/srnyx/annoyingapi/AnnoyingStats.java @@ -24,6 +24,7 @@ public class AnnoyingStats { public AnnoyingStats(@NotNull AnnoyingPlugin plugin) { // API final Metrics api = new Metrics(plugin, 18281); + api.addCustomChart(new SimplePie("annoying_api_version", AnnoyingPlugin.ANNOYING_API_VERSION::toString)); api.addCustomChart(new SimplePie("plugins", plugin::getName)); api.addCustomChart(new SimplePie("storage_method", () -> plugin.dataManager == null ? "N/A" : plugin.dataManager.storageConfig.method.name()));