AppleSkin

AppleSkin

236M Downloads

foods with no hunger/saturation should be ignored

Opened this issue ยท 7 comments

commented

forge: 36.1.17
MC: 1.16.5
AppleSkin: 1.16.4-2.0.0

Some foods, like the vault burger and oozing pizza from the Vault Hunters mod, actually have 0 hunger/saturation

This causes a blank line and a faint black hunger honch to be drawn. Foods with no food values should be ignored

https://imgur.com/a/Esl3fnD

commented

This should already be the case:

boolean shouldRenderHungerBars()
{
return hungerBars > 0;
}
boolean shouldRenderSaturationBars()
{
return saturationBars > 0;
}

Will need to look into what's happening more.

commented

is it because of line 138 ? the max being set to 1?

saturationBars = (int) Math.max(1, Math.ceil(Math.abs(biggestSaturationIncrement) / 2f));

commented

Good catch, that's definitely it.

Note to self: it also seems weird to evaluate hunger and saturation rendering separately. If one is rendered, both should be I think (and vice versa; if one is not rendered, neither should be).

commented

but sometime, someplace, somewhere there'll be occasion where a food has hunger and no sat, and vice versa? maybe?

commented

@squeek502 Could food. saturationModifier be a negative number?

commented

Yes, AppleSkin should already negative saturation. See #35 and joshiejack/Mariculture#125.

commented
  • 0 hunger and non-zero saturation is impossible, since saturation is calculated via food.hunger * food.saturationModifier.
  • Non-zero hunger and 0 saturation is possible, but it would be better to render 0x <saturation icon> than not render saturation at all (should be easy to extend our current 'large saturation' text rendering to handle the zero case)