Hydration/Exhaustion Bug
eddy0820 opened this issue · 5 comments
What's the issue you encountered?
Don't know if this is intentional or not but hitting the exhaustion threshold always resets your hydration to zero, I assumed it was like vanilla hunger where it would just subtract one from the hydration but it just resets to zero.
I found out the saturation value when I was making a AppleSkin like addon for the mod by just logging it every frame, looking through the ThirstHandler class I see that 1.0 is subtracted when hitting the exhaustion threshold while if it were intended to be like vanilla hunger 0.1 is what I would think is the correct value.
New to modding in general so forgive me if I am incorrect.
How can the issue be reproduced?
This is just a general issue that can found by sprinting or jumping
Logs
No response
Mod Version
1.19-8.0.0.78
Additional information
No response
This is inaccurate. Vanilla also subtracts 1.0 from saturation once its threshold of 4.0 has been reached:
public void tick(Player p_38711_) {
Difficulty difficulty = p_38711_.level.getDifficulty();
this.lastFoodLevel = this.foodLevel;
if (this.exhaustionLevel > 4.0F) {
this.exhaustionLevel -= 4.0F;
if (this.saturationLevel > 0.0F) {
this.saturationLevel = Math.max(this.saturationLevel - 1.0F, 0.0F);
} else if (difficulty != Difficulty.PEACEFUL) {
this.foodLevel = Math.max(this.foodLevel - 1, 0);
}
}
I see, my bad!
That being said, is hydration being reset to zero after hitting the exhaustion threshold intended?
Again sorry for the brother, but isn’t hydration always less than 1.0 due to hydration being measured from 0.0-1.0 (those are the values I see when debugging).