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:
@@ -230,7 +230,7 @@ recipes:
|
|||||||
10:
|
10:
|
||||||
name: Fader Kaffee/Kaffee/Starker Kaffee
|
name: Fader Kaffee/Kaffee/Starker Kaffee
|
||||||
ingredients:
|
ingredients:
|
||||||
- Ink_Sac,3/12
|
- Cocoa_Beans/12
|
||||||
- Milk_Bucket/2
|
- Milk_Bucket/2
|
||||||
cookingtime: 2
|
cookingtime: 2
|
||||||
color: BLACK
|
color: BLACK
|
||||||
|
|||||||
@@ -102,7 +102,7 @@ public class P extends JavaPlugin {
|
|||||||
metrics.addCustomChart(new Metrics.SingleLineChart("barrels_built", () -> Barrel.barrels.size()));
|
metrics.addCustomChart(new Metrics.SingleLineChart("barrels_built", () -> Barrel.barrels.size()));
|
||||||
metrics.addCustomChart(new Metrics.SingleLineChart("cauldrons_boiling", () -> BCauldron.bcauldrons.size()));
|
metrics.addCustomChart(new Metrics.SingleLineChart("cauldrons_boiling", () -> BCauldron.bcauldrons.size()));
|
||||||
metrics.addCustomChart(new Metrics.AdvancedPie("brew_quality", () -> {
|
metrics.addCustomChart(new Metrics.AdvancedPie("brew_quality", () -> {
|
||||||
Map<String, Integer> map = new HashMap<>();
|
Map<String, Integer> map = new HashMap<>(5);
|
||||||
int exc = 0;
|
int exc = 0;
|
||||||
int good = 0;
|
int good = 0;
|
||||||
int norm = 0;
|
int norm = 0;
|
||||||
@@ -129,6 +129,26 @@ public class P extends JavaPlugin {
|
|||||||
map.put("terrible", terr);
|
map.put("terrible", terr);
|
||||||
return map;
|
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) {
|
} catch (Throwable e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user