Count fluids by their type to avoid unnecessary reads in Entity#updateFluidHeightAndDoFluidPushing#40
Open
wuangg wants to merge 1 commit intoTuinity:mc/1.21.1from
Open
Count fluids by their type to avoid unnecessary reads in Entity#updateFluidHeightAndDoFluidPushing#40wuangg wants to merge 1 commit intoTuinity:mc/1.21.1from
wuangg wants to merge 1 commit intoTuinity:mc/1.21.1from
Conversation
7599f72 to
0ccedba
Compare
embeddedt
suggested changes
Oct 5, 2024
Contributor
embeddedt
left a comment
There was a problem hiding this comment.
The logic here does not look correct for modded. Water and lava are not the only possible fluids.
I would suggest making the count generic and just counting non-empty fluidstates in the chunk section instead.
Author
|
Since Fabric/Vanilla version of the method has the TagKey as a parameter, we would like to only check for the count of non-empty fluid states that have the same fluid TagKey to avoid unnecessary chunk section searches that do not have any fluid has the same TagKey as the parameter. As for modded fluid/NeoForge version of the method, I will implement a counter for generic non-empty fluid states. |
5fea434 to
0f27657
Compare
…eFluidHeightAndDoFluidPushing We can take fluid counts in a chunk section into account to avoid unnecessary searches as we were only checking for non empty blocks.
0f27657 to
636e70d
Compare
Author
|
Counter for generic non-empty fluid states has been implemented. |
This file contains hidden or 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
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.
Avoid searching for chunk sections that don't only have non empty blocks, but also non empty fluids