Skip to content

Commit

Permalink
Updated Metrics to latest version.
Browse files Browse the repository at this point in the history
  • Loading branch information
tastybento committed Sep 30, 2017
1 parent 92fd617 commit f90b504
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions src/com/wasteofplastic/askyblock/ASkyBlock.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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<String>() {
@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";
Expand All @@ -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<Integer>() {
@Override
public int getValue() {
return plugin.getGrid().getIslandCount();
public Integer call() throws Exception {
return getGrid().getIslandCount();
}
});
}));
}
}

0 comments on commit f90b504

Please sign in to comment.