HungerOverhaul icon indicating copy to clipboard operation
HungerOverhaul copied to clipboard

API request

Open VladoCC opened this issue 6 years ago • 3 comments

Okey, @progwml6 said that I need towrite issue here to ask about api for Get Back To Home mod. I want to get: -Food values (hunger, saturation) -Some way to get how exhaustion works with your mod. You changes it in some pats, right?

VladoCC avatar Jul 01 '18 11:07 VladoCC

Food values can be retrieved using the AppleCore API (which is what Hunger Overhaul uses under the hood to modify food values):

  • https://github.com/squeek502/AppleCore/blob/HEAD/java/squeek/applecore/api/IAppleCoreAccessor.java#L23-L42

Example:

AppleCoreAPI.accessor.getFoodValues(itemStack);

HO affects exhaustion in a few ways:

squeek502 avatar Jul 01 '18 21:07 squeek502

If my mod was loaded earlier than HO, can it get values changed by HO from AppleCore API?

And is it all changes to exhaustion? I think that I saw some info about formula for speeding down exhaustion when player is low on hunger.

VladoCC avatar Jul 02 '18 01:07 VladoCC

If my mod was loaded earlier than HO, can it get values changed by HO from AppleCore API?

Yes, load order doesn't matter at all for this (or anything else AppleCore related, I believe).

And is it all changes to exhaustion? I think that I saw some info about formula for speeding down exhaustion when player is low on hunger.

Depends what you mean by exhaustion. If you mean the FoodStats.foodExhaustionLevel field, then, yes, what I linked are the only changes to how that works. If you mean 'exhaustion' as a general concept, then HO does do some other stuff like apply potion effects when the player is low on hunger/health.

squeek502 avatar Jul 02 '18 02:07 squeek502