From f90b504db4fa9e955df9e50a57518904c3469294 Mon Sep 17 00:00:00 2001 From: tastybento Date: Sat, 30 Sep 2017 07:58:03 -0700 Subject: [PATCH] Updated Metrics to latest version. --- .../wasteofplastic/askyblock/ASkyBlock.java | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/com/wasteofplastic/askyblock/ASkyBlock.java b/src/com/wasteofplastic/askyblock/ASkyBlock.java index 663eaaef2..80420bbc7 100644 --- a/src/com/wasteofplastic/askyblock/ASkyBlock.java +++ b/src/com/wasteofplastic/askyblock/ASkyBlock.java @@ -20,6 +20,7 @@ import java.io.File; import java.util.HashMap; import java.util.UUID; +import java.util.concurrent.Callable; import org.bukkit.Bukkit; import org.bukkit.ChatColor; @@ -950,10 +951,10 @@ public PlayerEvents getPlayerEvents() { * Registers the custom charts for Metrics */ public void registerCustomCharts(){ - metrics.addCustomChart(new Metrics.SimplePie("challenges_count") { - + metrics.addCustomChart(new Metrics.SimplePie("challenges_count", new Callable() { @Override - public String getValue() { + public String call() throws Exception { + int count = challenges.getAllChallenges().size(); if(count <= 0) return "0"; else if(count >= 1 && count <= 10) return "1-10"; @@ -968,14 +969,13 @@ public String getValue() { else if(count >= 201 && count <= 300) return "201-300"; else return "300+"; } - }); + })); - metrics.addCustomChart(new Metrics.SingleLineChart("islands_count") { - + metrics.addCustomChart(new Metrics.SingleLineChart("islands_count", new Callable() { @Override - public int getValue() { - return plugin.getGrid().getIslandCount(); + public Integer call() throws Exception { + return getGrid().getIslandCount(); } - }); + })); } }