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 { public class BStats {
private static final int BSTATS_ID = 3555;
private final BentoBox plugin; private final BentoBox plugin;
private final int bstatsId;
private Metrics metrics; private Metrics metrics;
/** /**
@ -25,14 +26,13 @@ public class BStats {
*/ */
private int islandsCreatedCount = 0; private int islandsCreatedCount = 0;
BStats(BentoBox plugin, int bstatsId) { BStats(BentoBox plugin) {
this.plugin = plugin; this.plugin = plugin;
this.bstatsId = bstatsId;
} }
void registerMetrics() { void registerMetrics() {
if (metrics == null) { if (metrics == null) {
metrics = new Metrics(plugin, bstatsId); metrics = new Metrics(plugin, BSTATS_ID);
registerCustomMetrics(); registerCustomMetrics();
} }
} }

View File

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