Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

1.20 incompatible - I found some info and possible solution #4

Open
marosiak opened this issue Jan 29, 2025 · 1 comment
Open

1.20 incompatible - I found some info and possible solution #4

marosiak opened this issue Jan 29, 2025 · 1 comment

Comments

@marosiak
Copy link

Hi, idea of this mod is genius and I am big fan of such approach to starvation, anyway sadly I am not able to enjoy it at 1.2

I've started debugging a bit

[Server Error] Exception: Method not found: 'Void Vintagestory.GameContent.EntityBehaviorHealth.set__playerHealthRegenSpeed(Single)'.
at Starvation.EntityBehaviorStarve.ServerTickSlow(Single deltaTime)

Line which is broken:

bh._playerHealthRegenSpeed = (float) (baseRegenSpeed * HealthRegenPenalty());

How to fix?

That's good question, never modded vintage story or used C#, anyway it looks like there's new way of assigning health regen, I tried to find it using dnspy but without success yet

Posslbe fix

At discord user "Nat" suggested that nowdays you could use
var healthRegenSpeed = entity is EntityPlayer ? entity.Api.World.Config.GetString("playerHealthRegenSpeed", "1").ToFloat() : entity.WatchedAttributes.GetFloat("regenSpeed", 1);

Anyway, I am not sure if it will work as I can't find proof that such property as "regenSpeed" even exists in the game

@marosiak
Copy link
Author

My solution #5

@marosiak marosiak changed the title 1.2 incompatible - I found some info and possible solution 1.20 incompatible - I found some info and possible solution Jan 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant