Add bStats plugin version

bStats 1.7 requires plugins to have an ID to submit data.
This commit is contained in:
NotMyFault 2020-01-24 16:08:48 +01:00
parent 57af89f1d0
commit 0953b5627e
2 changed files with 4 additions and 2 deletions

View File

@ -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.");
}

View File

@ -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!");
}