Skip to content

Commit

Permalink
Add 'exact_count' formula variable that ignores food groups
Browse files Browse the repository at this point in the history
 - Closes #106
  • Loading branch information
squeek502 committed Feb 2, 2017
1 parent c3702b1 commit 3171143
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 2 additions & 1 deletion java/squeek/spiceoflife/ModConfig.java
Expand Up @@ -222,7 +222,8 @@ private RoundingMode(String id)
+ "\ttotal_food_eaten : The all-time total number of times any food has been eaten by the player\n"
+ "\tfood_group_count : The number of food groups that the food belongs to\n"
+ "\tdistinct_food_groups_eaten : The number of distinct food groups in the player's current food history\n"
+ "\ttotal_food_groups : The total number of enabled food groups\n";
+ "\ttotal_food_groups : The total number of enabled food groups\n"
+ "\texact_count : The number of times the food (ignoring food groups) has been eaten within the food history\n";

public static boolean GIVE_FOOD_JOURNAL_ON_START = ModConfig.GIVE_FOOD_JOURNAL_ON_START_DEFAULT;
private static final String GIVE_FOOD_JOURNAL_ON_START_NAME = "give.food.journal.as.starting.item";
Expand Down
1 change: 1 addition & 0 deletions java/squeek/spiceoflife/foodtracker/FoodModifier.java
Expand Up @@ -105,6 +105,7 @@ public static float getFoodGroupModifier(FoodHistory foodHistory, ItemStack food
.and("food_group_count", new BigDecimal(FoodGroupRegistry.getFoodGroupsForFood(food).size()))
.and("distinct_food_groups_eaten", new BigDecimal(foodHistory.getDistinctFoodGroups().size()))
.and("total_food_groups", new BigDecimal(FoodGroupRegistry.numFoodGroups()))
.and("exact_count", new BigDecimal(foodHistory.getFoodCountIgnoringFoodGroups(food)))
.eval();

return result.floatValue();
Expand Down

0 comments on commit 3171143

Please sign in to comment.