diff --git a/src/main/java/org/maxgamer/quickshop/Metrics.java b/src/main/java/org/maxgamer/quickshop/Metrics.java index 4440d0fc6..7fa99b8b8 100644 --- a/src/main/java/org/maxgamer/quickshop/Metrics.java +++ b/src/main/java/org/maxgamer/quickshop/Metrics.java @@ -7,6 +7,7 @@ import org.bukkit.entity.Player; import org.bukkit.plugin.RegisteredServiceProvider; import org.bukkit.plugin.ServicePriority; import org.bukkit.plugin.java.JavaPlugin; +import org.bukkit.scheduler.BukkitRunnable; import org.json.simple.JSONArray; import org.json.simple.JSONObject; @@ -141,6 +142,8 @@ public class Metrics { } // Nevertheless we want our code to run in the Bukkit main thread, so we have to use the Bukkit scheduler // Don't be afraid! The connection to the bStats server is still async, only the stats collection is sync ;) + + submitData(); Bukkit.getScheduler().runTask(plugin, new Runnable() { @Override public void run() { @@ -187,7 +190,7 @@ public class Metrics { * * @return The server specific data. */ - private JSONObject getServerData() { + public JSONObject getServerData() { // Minecraft specific data int playerAmount; try { @@ -231,7 +234,7 @@ public class Metrics { /** * Collects the data and sends it afterwards. */ - private void submitData() { + public void submitData() { final JSONObject data = getServerData(); JSONArray pluginData = new JSONArray(); diff --git a/src/main/java/org/maxgamer/quickshop/QuickShop.java b/src/main/java/org/maxgamer/quickshop/QuickShop.java index 8cddf4642..7f6fd9340 100644 --- a/src/main/java/org/maxgamer/quickshop/QuickShop.java +++ b/src/main/java/org/maxgamer/quickshop/QuickShop.java @@ -26,7 +26,6 @@ import java.util.UUID; import javax.net.ssl.HttpsURLConnection; -import org.bstats.bukkit.Metrics; import org.bukkit.Bukkit; import org.bukkit.ChatColor; import org.bukkit.Location; @@ -267,7 +266,7 @@ public class QuickShop extends JavaPlugin { metrics.addCustomChart(new Metrics.SimplePie("use-protect-structuregrow",() ->use_protect_structuregrow)); metrics.addCustomChart(new Metrics.SimplePie("use-protect-explode",() -> use_protect_explode)); metrics.addCustomChart(new Metrics.SimplePie("use-protect-hopper", () ->use_protect_hopper)); - + metrics.submitData(); //Submit now! }else { getLogger().info("You have disabled mertics, Skipping..."); }