Skip to content

Finish adding FluidState API#9951

Merged
Owen1212055 merged 12 commits into
PaperMC:masterfrom
viciscat:FluidState-API
Feb 17, 2024
Merged

Finish adding FluidState API#9951
Owen1212055 merged 12 commits into
PaperMC:masterfrom
viciscat:FluidState-API

Conversation

@viciscat
Copy link
Copy Markdown
Contributor

This pull request adds the FluidState API started by MachineMaker in PR #8609.
It adds everything in the PR's todo list. I tested the methods and they returned everything correctly. I don't really know what more I could say. Feel free to ask any questions!

@viciscat viciscat requested a review from a team as a code owner November 18, 2023 13:51
Copy link
Copy Markdown
Contributor

@Sytm Sytm left a comment

Choose a reason for hiding this comment

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

Also where did the methods on the BlockState go that the original PR had?

Comment thread patches/api/0447-Add-FluidState-API.patch Outdated
Comment thread patches/server/1051-Add-FluidState-API.patch Outdated
Comment thread patches/server/1051-Add-FluidState-API.patch Outdated
@viciscat
Copy link
Copy Markdown
Contributor Author

viciscat commented Nov 18, 2023

Also where did the methods on the BlockState go that the original PR had?

Owen said on Discord that we probably shouldn't couple liquid with blocks. That's the main reason for the fact it's not there. I could still add it tho. If do add it, should I make it a new patch or edit the existing one?

@Sytm
Copy link
Copy Markdown
Contributor

Sytm commented Nov 18, 2023

Owen said on Discord that we probably shouldn't couple liquid with blocks. That's the main reason for the fact it's not there. I could still add it tho. If do add it, should I make it a new patch or edit the existing one?

If Owen said that you can leave it like it currently is, he is more knowledgeable around this stuff after all.

Copy link
Copy Markdown
Member

@Owen1212055 Owen1212055 left a comment

Choose a reason for hiding this comment

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

In general I think this api is very helpful, but I think we need to move a bit in a different direction here. More specifically, you're sort of mashing the BlockData concept of being "wordless" and BlockStates "world" idea.

Since you're introducing methods that require a world, but also some that don't.

cc @Lulu13022002

Comment thread patches/api/0446-Add-FluidState-API.patch Outdated
Comment thread patches/api/0446-Add-FluidState-API.patch Outdated
Comment thread patches/api/0446-Add-FluidState-API.patch Outdated
Comment thread patches/api/0446-Add-FluidState-API.patch Outdated
Comment thread patches/server/1047-Add-FluidState-API.patch Outdated
@viciscat
Copy link
Copy Markdown
Contributor Author

you're sort of mashing the BlockData concept of being "wordless" and BlockStates "world" idea.
Since you're introducing methods that require a world, but also some that don't.

So should I do methods that require a world or not? I would say they don't require a world since you get the FluidData from the World.

@viciscat
Copy link
Copy Markdown
Contributor Author

(Continuing on my previous comment)
The thing is that some methods in FluidState just don't need a Level and position like getAmount and getHeight since it can just read it from the block properties (you know, the data you can see when looking at a fluid with F3). getFlowDirection really is just the only one that needs a position and level

Comment thread patches/api/0446-Add-FluidState-API.patch Outdated
Comment thread patches/api/0446-Add-FluidState-API.patch Outdated
Comment thread patches/api/0446-Add-FluidState-API.patch Outdated
Comment thread patches/api/0446-Add-FluidState-API.patch Outdated
Comment thread patches/server/1047-Add-FluidState-API.patch Outdated
Comment thread patches/api/0446-Add-FluidState-API.patch Outdated
Comment thread patches/server/1047-Add-FluidState-API.patch Outdated
Comment thread patches/server/1047-Add-FluidState-API.patch Outdated
Comment thread patches/api/0446-Add-FluidState-API.patch Outdated
Comment thread patches/server/1047-Add-FluidState-API.patch Outdated
Comment thread patches/api/0446-Add-FluidState-API.patch Outdated
Comment thread patches/api/0446-Add-FluidState-API.patch Outdated
Comment thread patches/api/0446-Add-FluidState-API.patch Outdated
Comment thread patches/api/0446-Add-FluidState-API.patch Outdated
Comment thread patches/api/0446-Add-FluidState-API.patch Outdated
Comment thread patches/api/0449-Add-FluidState-API.patch Outdated
Comment thread patches/api/0449-Add-FluidState-API.patch Outdated
Comment thread patches/api/0449-Add-FluidState-API.patch Outdated
viciscat and others added 11 commits February 17, 2024 15:08
This commit adds a new FluidState API to the system. It introduces various methods to get information from fluid states in the game, such as checking if a block is a fluid source, getting the amount of fluid, type of the fluid (water or lava), and its flow direction. It helps to enhance flexibility when managing fluid dynamics in the game. Alongside new API, it also modifies the existing `RegionAccessor` class to incorporate the functionalities of the FluidState API.
oh god I hope I did this right
@Owen1212055 Owen1212055 merged commit d95341e into PaperMC:master Feb 17, 2024
lynxplay added a commit to lynxplay/paper that referenced this pull request Feb 23, 2024
* Add new FluidState API functionality
---------

Co-authored-by: Bjarne Koll <lynxplay101@gmail.com>
Co-authored-by: Owen1212055 <23108066+Owen1212055@users.noreply.github.com>
LeonTG pushed a commit to LeonTG/Paper that referenced this pull request May 17, 2026
* Add new FluidState API functionality
---------

Co-authored-by: Bjarne Koll <git@lynxplay.dev>
Co-authored-by: Owen1212055 <23108066+Owen1212055@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Merged

Development

Successfully merging this pull request may close these issues.

6 participants