Add bStats metrics

This commit is contained in:
Eric 2020-03-19 15:17:56 +01:00
parent eaedd42e8d
commit 6d16b39597

View File

@ -14,6 +14,7 @@ import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParser;
import org.bstats.bukkit.Metrics;
import org.bukkit.Chunk;
import org.bukkit.World;
import org.bukkit.command.Command;
@ -69,6 +70,7 @@ public class ShopChestImpl extends ShopChest {
return;
}
loadMetrics();
registerCommand();
registerEvents();
loadDatabase();
@ -118,6 +120,13 @@ public class ShopChestImpl extends ShopChest {
return this.economy != null;
}
private void loadMetrics() {
Metrics metrics = new Metrics(this, 1726);
metrics.addCustomChart(new Metrics.SimplePie("database_type", () -> Config.DATABASE_TYPE.get().toString()));
metrics.addCustomChart(new Metrics.SimplePie("creative_setting", () ->
Config.FEATURES_CREATIVE_ITEM_SELECTION.get() ? "Enabled" : "Disabled"));
}
private void registerEvents() {
getServer().getPluginManager().registerEvents(new ShopCommandMonitorListener(this), this);
getServer().getPluginManager().registerEvents(new ShopCommandListener(this), this);