From 312b2ad1a8a118b495cf462ed16b04ce1c5a9cd7 Mon Sep 17 00:00:00 2001 From: NotMyFault Date: Fri, 24 Jan 2020 18:10:19 +0100 Subject: [PATCH] Send the bStats ID --- .../intellectualsites/plotsquared/bukkit/util/Metrics.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/Metrics.java b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/Metrics.java index b7c1a9b3a..b5d53e940 100644 --- a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/Metrics.java +++ b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/Metrics.java @@ -79,6 +79,9 @@ public class Metrics { // The plugin private final Plugin plugin; + // The plugin id + private final int bstatsId; + // A list with all custom charts private final List charts = new ArrayList<>(); @@ -86,13 +89,14 @@ public class Metrics { * Class constructor. * * @param plugin The plugin which stats should be submitted. - * @param bstatsId ID of the plugin + * @param bstatsId The ID of the plugin. It can be found in the url when you open the plugin on bStats. */ public Metrics(Plugin plugin, int bstatsId) { if (plugin == null) { throw new IllegalArgumentException("Plugin cannot be null!"); } this.plugin = plugin; + this.bstatsId = bstatsId; // Get the config file File bStatsFolder = new File(plugin.getDataFolder().getParentFile(), "bStats"); @@ -207,6 +211,7 @@ public class Metrics { String pluginVersion = plugin.getDescription().getVersion(); data.put("pluginName", pluginName); // Append the name of the plugin + data.put("id", bstatsId); // Append the id of the plugin data.put("pluginVersion", pluginVersion); // Append the version of the plugin JSONArray customCharts = new JSONArray(); for (CustomChart customChart : charts) {