Skip to content

Commit

Permalink
Merge branch '1.20' of https://github.com/TeamMoegMC/FrostedHeart int…
Browse files Browse the repository at this point in the history
…o 1.20
  • Loading branch information
khjxiaogu committed Dec 30, 2024
2 parents 43e02be + 2888190 commit d1f53c9
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -131,13 +131,13 @@ public void eat(Player player, ItemStack food) {
NutritionRecipe wRecipe = NutritionRecipe.getRecipeFromItem(level, food);
int nutrition = food.getFoodProperties(player).getNutrition();
//因为只看食物自己的属性会比较低,加的点数不够一分钟的消耗,所以需要再乘一个系数
Nutrition n = wRecipe.getNutrition().scale(nutrition).scale(10.0f);
Nutrition n = wRecipe.getNutrition().scale(nutrition).scale(40.0f);
modifyNutrition(player, n);
}

public void consume(Player player) {
// 这个比例可以放到Config里
float radio = 0.1f * FHConfig.SERVER.nutritionConsumptionRate.get();
float radio = - 0.1f * FHConfig.SERVER.nutritionConsumptionRate.get();

Nutrition nutrition = get();
modifyNutrition(player, nutrition.scale(radio / nutrition.getNutritionValue()));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,14 +77,14 @@ public static List<Component> getFoodStats(Item item, ItemStack stack, Player pl
}
return list;
}
private static void addLine(List<Component> list,String suffix,float value,int color) {

int progress = Mth.ceil(Mth.clamp(value * 3, 0, 3));

LangBuilder builder = Lang.translate("tooltip", "nutrition."+suffix)
.add(Lang.text(" " + TooltipHelper.makeProgressBar(3, progress))
.style(Style.EMPTY.withColor(color)));
builder.addTo(list);
}
//
// private static void addLine(List<Component> list,String suffix,float value,int color) {
//
// int progress = Mth.ceil(Mth.clamp(value * 3, 0, 3));
//
// LangBuilder builder = Lang.translate("tooltip", "nutrition."+suffix)
// .add(Lang.text(" " + TooltipHelper.makeProgressBar(3, progress))
// .style(Style.EMPTY.withColor(color)));
// builder.addTo(list);
// }
}

0 comments on commit d1f53c9

Please sign in to comment.