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

Mycelial Sourcelink's source generation doesn't match between versions (1.20 and 1.21) #1619

Open
Pickpocke opened this issue Feb 2, 2025 · 2 comments

Comments

@Pickpocke
Copy link

Both 1.20 and 1.21 use the same formula for source generation from saturation:
mana += (int) (30.0 * ((<Saturation> * 2.0)))
The problem is, 1.20 uses saturationModifier value, while 1.21 uses saturation value
Those are not the same values for almost any given food
Formula for deriving the saturation value from saturationModifier in 1.20 is (nutrition * saturationModifier * 2), while 1.20.5 and onwards saturation is simply specified in data

Formula for source generation from saturation value in 1.20 matching resulting source from 1.20.1 formula would be as follows:
mana += (int) (30.0 * (((food.getNutrition() * food.getSaturationModifier() * 2) * 2.0)));

#1500 actually brings up the issue, but it wasn't understood correctly before the issue was closed
If we use the formula before the alleged "fix" relating to the issue, the fixed formulas would be as follows:
For 1.20: mana += (int) 30 * (food.getNutrition() * food.getSaturationModifier() * 2)
For 1.21: mana += (int) 30 * food.saturation();

@baileyholl
Copy link
Owner

The food values for 1.21 were intentionally increased from how they are in 1.20. Are there outliers or disagreements with the calculation as it is now, or were you just pointing out the mismatch?

@Pickpocke
Copy link
Author

I see. Maybe you should add a comment there so other people wouldn't be confused?

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

2 participants