Moved BSTATS_ID to the BStats class

This commit is contained in:
Florian CUNY 2020-03-21 10:49:58 +01:00
parent 979fc021d0
commit e322f4047a
2 changed files with 5 additions and 6 deletions

View File

@ -14,8 +14,9 @@ import world.bentobox.bentobox.api.flags.Flag;
*/
public class BStats {
private static final int BSTATS_ID = 3555;
private final BentoBox plugin;
private final int bstatsId;
private Metrics metrics;
/**
@ -25,14 +26,13 @@ public class BStats {
*/
private int islandsCreatedCount = 0;
BStats(BentoBox plugin, int bstatsId) {
BStats(BentoBox plugin) {
this.plugin = plugin;
this.bstatsId = bstatsId;
}
void registerMetrics() {
if (metrics == null) {
metrics = new Metrics(plugin, bstatsId);
metrics = new Metrics(plugin, BSTATS_ID);
registerCustomMetrics();
}
}

View File

@ -87,7 +87,6 @@ public class BentoBox extends JavaPlugin {
// Metrics
@Nullable
private BStats metrics;
private static final int BSTATS_ID = 3555;
private Config<Settings> configObject;
@ -196,7 +195,7 @@ public class BentoBox extends JavaPlugin {
flagsManager.registerListeners();
// Load metrics
metrics = new BStats(this, BSTATS_ID);
metrics = new BStats(this);
metrics.registerMetrics();
// Register Multiverse hook - MV loads AFTER BentoBox