forked from WayofTime/BloodMagic
-
Notifications
You must be signed in to change notification settings - Fork 28
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
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
update bs+deps+gardle
combusterf
requested changes
Jan 12, 2024
src/main/java/WayofTime/alchemicalWizardry/common/rituals/RitualEffectBiomeChanger.java
Show resolved
Hide resolved
combusterf
approved these changes
Jan 21, 2024
There was a problem hiding this 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.
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.