Skip to content

Commit

Permalink
Added number of recipes Chart
Browse files Browse the repository at this point in the history
  • Loading branch information
Sn0wStorm committed Jan 17, 2019
1 parent dac29b3 commit c063037
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 3 deletions.
4 changes: 2 additions & 2 deletions resources/config/v13/de/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ recipes:
10:
name: Fader Kaffee/Kaffee/Starker Kaffee
ingredients:
- Ink_Sac,3/12
- Cocoa_Beans/12
- Milk_Bucket/2
cookingtime: 2
color: BLACK
Expand Down Expand Up @@ -534,4 +534,4 @@ words:
- replace: -all
to: '*rülps*'
percentage: 3
alcohol: 60
alcohol: 60
22 changes: 21 additions & 1 deletion src/com/dre/brewery/P.java
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ public void onEnable() {
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;
Expand All @@ -129,6 +129,26 @@ public void onEnable() {
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();
}
Expand Down

0 comments on commit c063037

Please sign in to comment.