yeelp / Scaling-Feast

A simple, balanced way to increase your maximum hunger in Minecraft over the course of a world.
MIT License
0 stars 1 forks source link

Metabolism doesn't respect saturation cap #69

Closed yeelp closed 4 years ago

yeelp commented 4 years ago

With saturation scaling on, or a saturation hard cap, Metabolism just ignores this and still gives saturation only being bounded by a player's food level.

SonicX8000 commented 4 years ago

While not related... this sorta gives an idea where you could allow an overflow of some sorts. If you have 19/20 saturation and you eat a food item that gives 6 saturation... you'll have 25/20 saturation.

This would be a one-time thing as long as you're below the max saturation cap. If you already have 20/20 saturation then you cannot overflow your saturation. Same thing if you have 25/20 saturation it won't go any hunger unless you're below max saturation, which in this case is 20.

It'll still respect the player's food level so it'll mainly be used when you halve/quarter saturation based on max hunger or use the saturation cap.

yeelp commented 4 years ago

This is basically Saturation Overflow in a nutshell. If anything, I would just add a way to get this saturation overflow value and add it to whatever is displayed in the HUD. The code is open source on GitLab, so this shouldn't be too complicated if I choose to do it.

SonicX8000 commented 4 years ago

Some more info to add for this issue. The Vanilla Potion Effect 'Saturation' can also bypass the cap or if other modded stuff that affects saturation. Although I don't think you can get the vanilla effect itself in survival unless you use commands... but there are other ways. Just to name a few...


Biscuit of Totality from Botania: Gives you roughly a 1 second Vanilla Saturation Effect which regens up to 20 Saturation/Hunger.

Saturation Potion from Potion Core: Recovers Saturation & Hunger when drunk.

Life Leech Enchantment from Cyclic: Restores Saturation/Hunger based on Mob Health when KO'd.

Saturation Potion from Cyclic: This is a different type of Saturation Effect, grants a passive regen of both Saturation & Hunger overtime.

Saturation Environmental Module from RF Tools: Grants the Vanilla Saturation Effect when put inside a Environmental Controller & is able to affect players. Pretty much infinite hunger/saturation as long as you have enough power for the controller.


Eating food-like items appears to set the saturation value back to whatever you have the max cap set at so maybe a check where if it's above the saturation cap, set the value back to the max cap?

yeelp commented 4 years ago

Yeah what's happening here is when a food item is eaten, I cap player saturation. But, when foodstats are added (which does occur when a food item is eaten, but can also occur through things like potion effects (i.e. Metabolism)), I forget to cap player saturation. This is why eating a food item reverts it. Adding a quick check on the FoodStatsAdditionEvent and removing the check on the FoodEatenEvent (since it's probably redundant at this point) should solve the problem, I just haven't gotten around to it yet.