From 6d16b39597d64fd671a9d240213202d7affef214 Mon Sep 17 00:00:00 2001 From: Eric Date: Thu, 19 Mar 2020 15:17:56 +0100 Subject: [PATCH] Add bStats metrics --- .../main/java/de/epiceric/shopchest/ShopChestImpl.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/core/src/main/java/de/epiceric/shopchest/ShopChestImpl.java b/core/src/main/java/de/epiceric/shopchest/ShopChestImpl.java index 65feb78..4336b49 100644 --- a/core/src/main/java/de/epiceric/shopchest/ShopChestImpl.java +++ b/core/src/main/java/de/epiceric/shopchest/ShopChestImpl.java @@ -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);