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

Ritual of Gaia's Transformation fixes. #49

Merged
merged 10 commits into from
Jan 21, 2024

Conversation

AbdielKavash
Copy link
Member

@AbdielKavash AbdielKavash commented Jan 4, 2024

Three fixes:

  • Added server->client notification of biome change. This means that the change is now visible on the client immediately, instead of having to relog to see the effect. I would appreciate somebody checking this; this is my first time writing MC networking code.

  • Fixed a floating point arithmetic error. The ritual allows the user to specify the temperature and humidity of the biome within a certain tolerance. However, the tolerance can line up exactly with the temp/hum of a biome, in which case floating point comparisons can lead to unexpected results. In some cases, even specifying the same tolerance interval using different combinations of reagents can result in a different biome being chosen. My fix to this is to lower the tolerance by a tiny epsilon; from the original code I believe that the intention was for the tolerance to be an open interval (not including values equal to the endpoints).

  • Replaced an extremely inefficient (n^3) algorithm looking for places to change biome with a simple BFS. The resulting logic is not changed.

@combusterf combusterf self-requested a review January 21, 2024 19:04
Copy link

@combusterf combusterf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

At least it looks safe now.

@Dream-Master Dream-Master merged commit ff2f889 into GTNewHorizons:master Jan 21, 2024
1 check passed
DrParadox7 pushed a commit to DrParadox7/BloodMagic that referenced this pull request Jan 26, 2025
* Added server->client notification of biome change.

* Fix floating point inaccuracy.

* Replaced inefficient search algorithm.

* Move structure initialization out of a loop. Oops.

* update bs+deps+gardle

* fix wci

* one more

* Always send full 32 bytes with every message.

---------

Co-authored-by: Martin Robertz <[email protected]>
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

Successfully merging this pull request may close these issues.

3 participants