mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2025-07-13 19:14:42 +02:00
add saturation support
This commit is contained in:
@ -79,7 +79,7 @@ public final class SkillUtils {
|
||||
* Others
|
||||
*/
|
||||
|
||||
public static int handleFoodSkills(Player player, int eventFoodLevel, SubSkillType subSkillType) {
|
||||
public static int handleFoodSkillsHunger(Player player, int eventFoodLevel, SubSkillType subSkillType) {
|
||||
int curRank = RankUtils.getRank(player, subSkillType);
|
||||
|
||||
int currentFoodLevel = player.getFoodLevel();
|
||||
@ -90,6 +90,17 @@ public final class SkillUtils {
|
||||
return currentFoodLevel + foodChange;
|
||||
}
|
||||
|
||||
public static float handleFoodSkillsSaturation(Player player, float eventSaturationLevel, SubSkillType subSkillType) {
|
||||
int curRank = RankUtils.getRank(player, subSkillType);
|
||||
|
||||
float currentSaturationLevel = player.getSaturation();
|
||||
float saturationChange = eventSaturationLevel - currentSaturationLevel;
|
||||
|
||||
saturationChange += curRank;
|
||||
|
||||
return currentSaturationLevel + saturationChange;
|
||||
}
|
||||
|
||||
/**
|
||||
* Calculate the time remaining until the cooldown expires.
|
||||
*
|
||||
|
Reference in New Issue
Block a user