Skip to content

Commit

Permalink
Add annoying_api_version to bStats
Browse files Browse the repository at this point in the history
Added `AnnoyingPlugin#ANNOYING_API_VERSION` for this
  • Loading branch information
srnyx committed Oct 27, 2024
1 parent 8b8cb4f commit a655388
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
3 changes: 2 additions & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions src/main/java/xyz/srnyx/annoyingapi/AnnoyingPlugin.java
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand Down
1 change: 1 addition & 0 deletions src/main/java/xyz/srnyx/annoyingapi/AnnoyingStats.java
Original file line number Diff line number Diff line change
Expand Up @@ -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()));

Expand Down

0 comments on commit a655388

Please sign in to comment.