Robotic Parts

Robotic Parts

1M Downloads

[1.12.2] Tweak the Metabolic Generator to affect Exhaustion instead of Hunger?

SonicX8000 opened this issue ยท 10 comments

commented

Minecraft: 1.12.2
Forge: 14.23.4.2708

Mods:
cyberware-1.12.2-0.2.10.12
ReWIRED-1.0.3


The Metabolic Generator cyberware part currently drains Hunger Points but doesn't take into account for Saturation & Exhaustion so pretty much you can have... say 0 Hunger but 20 Saturation + 0% Exhaustion if you wish.

This can cause a few odd things to happen, like if the hunger stat is low enough you won't recover health or be able to sprint with... say 6 Hunger & 20 Saturation.

If having the Saturation Potion Effect and you take damage while having 0/20 Hunger and 20/20 Saturation... Hunger will shoot back up to 20/20 as it restores loss health. Having it drain via Exhaustion will just effect Saturation but Hunger won't be affected.


Here in this screenshot with Applskin installed which shows the Saturation as well as Exhaustion values, my hunger stat was drained due to the Metabolic Generator but Saturation & Exhaustion were untouched.

The -50 drain rate was from using the AEGIS Skin from ReWIRED and the Exhaustion Value was manually there due to sprinting & jumping and such.

Would it be possible to have it affect Exhaustion instead of the Hunger stat directly? Like when the Metabolic Generator is in use it'll steadily increase your Exhaustion as it restores power which in due time will drain Saturation and then Hunger values.

commented

That's actually not a bad idea.

I know someone had put in a PR for it for the now inactive 1.10.2 version ... and I think they resubmitted it for this 1.12.2 port but it's not been accepted. We probably need to make sure the amount of exhaustion that's added properly reflects the benefit of the generator.

commented

With full Hunger & Saturation, it takes about +1100 Power (+25 power X 44 seconds) for it to remove 1 hunger point and Exhaustion appears to be capped at 4 before it resets back to 0 after it takes away 1 hunger point, at least what the Applskin's Debug Info shows anyway.

Not sure how Exhaustion works exactly, going to make a guess that it goes by ticks.

commented

I forgot I had already made a PR for the exhaustion, yea the commented out part was done because of a bug it caused if I'm remembering correctly.
The exhaustion value I have in the PR isn't exactly right, and might need a little bit of tweaking since back when I did the testing I didn't spend to much time tweaking it to make it exactly like the current use amount.

I can also say I compiled the mod for my own personal server a while back (With that change added), and the mechanic worked flawlessly, so not sure why this hasn't yet been implemented.

commented

I was correct, as you can see here making it not use saturation was due to a bug, which I had fixed.

commented

So with that PR, the Metabolic Generator will use exhaustion instead of hunger now, correct?

commented

Yes it will, which means it will first burn through saturation before going to base hunger. The way exhaustion stats work the saturation will be burned faster than normal hunger, which honestly isn't even a bad thing.

commented

@TheUnderTaker11
Since you compiled the mod for your personal server, I don't suppose I could take a look at it to see if it has a conflict with the mod "Saturation Overflow"? That mod allows you to go above 20 Saturation if you eat something while Saturation is below 20 and I wanted to see if it works with it.

commented

Well, this method just uses vanilla exhaustion, so the way hunger is lost here is exactly like how you lose hunger when running etc.
It's been a long time since I've compiled it, and that server is long since closed, but I would be extremely surprised if there was any conflict with that mod.

commented

well ...in the code, that feature is already implemented, but commented out (ignored).
Consider this a feature because, if you idle for too long and get a lot of damage you might regenerate a lot of life in a short amount of time.
So uncommenting that code will (if there is no bug) do what you are suggesting.
I personally like the way it is made :)
edit: in the code it has if saturation is 0 then consume hunger, if saturation is higher than 0, you consume saturation but again, this is commented out. Just removing the comment will allow that logic to run

commented

PR has been merged, open a new issue if an incompatibility is confirmed