From 0953b5627e8f663ae4a207878b884c123238990d Mon Sep 17 00:00:00 2001 From: NotMyFault Date: Fri, 24 Jan 2020 16:08:48 +0100 Subject: [PATCH] Add bStats plugin version bStats 1.7 requires plugins to have an ID to submit data. --- .../intellectualsites/plotsquared/bukkit/BukkitMain.java | 3 ++- .../intellectualsites/plotsquared/bukkit/util/Metrics.java | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/BukkitMain.java b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/BukkitMain.java index f6c82bc37..f799d0fd7 100644 --- a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/BukkitMain.java +++ b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/BukkitMain.java @@ -119,6 +119,7 @@ public final class BukkitMain extends JavaPlugin implements Listener, IPlotMain private Method methodUnloadChunk0; private boolean methodUnloadSetup = false; private boolean metricsStarted; + private static final int BSTATS_ID = 1404; @Override public int[] getServerVersion() { if (this.version == null) { @@ -689,7 +690,7 @@ public final class BukkitMain extends JavaPlugin implements Listener, IPlotMain return; } this.metricsStarted = true; - Metrics metrics = new Metrics(this);// bstats + Metrics metrics = new Metrics(this, BSTATS_ID);// bstats PlotSquared.log(Captions.PREFIX + "&6Metrics enabled."); } 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 edc2f9669..b7c1a9b3a 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 @@ -86,8 +86,9 @@ public class Metrics { * Class constructor. * * @param plugin The plugin which stats should be submitted. + * @param bstatsId ID of the plugin */ - public Metrics(Plugin plugin) { + public Metrics(Plugin plugin, int bstatsId) { if (plugin == null) { throw new IllegalArgumentException("Plugin cannot be null!"); }