yarn icon indicating copy to clipboard operation
yarn copied to clipboard

Changed FlowableFluid getVelocity method name to getFlowDirectionVect…

Open Levoment opened this issue 1 year ago • 3 comments

Changed FlowableFluid getVelocity method name to getFlowDirectionVector. Changed the argument in the same method with name state to mainFluidState. Also added a documentation for the method. This method tells the game the direction a fluid should flow by evaluating the level of other fluid blocks around it. It returns a 3D vector with numbers -1 OR 0 OR 1 for each component of the 3D vector to indicate what direction the fluid should flow towards.

I thought about using just getFlowDirection, but given that Direction is already a class that indicates something else, I went with getFlowDirectionVector to indicate in the name it returns a vector and not a Direction object. It is still a vector that is used to know the direction of flow from a fluid, but it's not a Direction object.

state I changed to mainFluidState to make it more clear in the code from the method that the variable holds the FluidState whose direction is desired since the method creates 2 other FluidState objects inside of it to make the calculations of flow direction.

Levoment avatar Sep 03 '22 09:09 Levoment

I just committed the suggestions.

Levoment avatar Sep 04 '22 03:09 Levoment

It returns a 3D vector with numbers -1 OR 0 OR 1 for each component of the 3D vector to indicate what direction the fluid should flow towards.

This might be good to include in the javadoc

Juuxel avatar Sep 14 '22 19:09 Juuxel

🚀 Target branch has been updated to 22w42a

github-actions[bot] avatar Oct 20 '22 17:10 github-actions[bot]