mirror of
https://github.com/exituser/Brewery.git
synced 2026-09-17 08:59:01 +00:00
Added number of recipes Chart
This commit is contained in:
@@ -102,7 +102,7 @@ public class P extends JavaPlugin {
|
||||
metrics.addCustomChart(new Metrics.SingleLineChart("barrels_built", () -> Barrel.barrels.size()));
|
||||
metrics.addCustomChart(new Metrics.SingleLineChart("cauldrons_boiling", () -> BCauldron.bcauldrons.size()));
|
||||
metrics.addCustomChart(new Metrics.AdvancedPie("brew_quality", () -> {
|
||||
Map<String, Integer> map = new HashMap<>();
|
||||
Map<String, Integer> map = new HashMap<>(5);
|
||||
int exc = 0;
|
||||
int good = 0;
|
||||
int norm = 0;
|
||||
@@ -129,6 +129,26 @@ public class P extends JavaPlugin {
|
||||
map.put("terrible", terr);
|
||||
return map;
|
||||
}));
|
||||
metrics.addCustomChart(new Metrics.SimplePie("number_of_recipes", () -> {
|
||||
int recipes = BIngredients.recipes.size();
|
||||
if (recipes < 7) {
|
||||
return "Less than 7";
|
||||
} else if (recipes < 11) {
|
||||
return "7-10";
|
||||
} else if (recipes == 11) {
|
||||
// There are 11 default recipes, so show this as its own slice
|
||||
return "11";
|
||||
} else if (recipes <= 31) {
|
||||
if (recipes % 2 == 0) {
|
||||
return recipes + "-" + (recipes + 1);
|
||||
} else {
|
||||
return (recipes - 1) + "-" + recipes;
|
||||
}
|
||||
} else {
|
||||
return "More than 31";
|
||||
}
|
||||
|
||||
}));
|
||||
} catch (Throwable e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user