Jump to content

[1.12] Get density of fluid in world.


Aidiah

Recommended Posts

I'm trying to figure out how to get the density of a fluid block in the world. I'd like to check it something like this:

world.getFluidDensity(pos)

But that obviously doesn't work.

Also I'm working with finite fluids if that matters

What is the best way to get a fluid block's density?

 

Edit: Is it also possible to change a fluid blocks density?

Edited by Aidiah
Link to comment
Share on other sites

Having another issue with getting the density, fluid 1 has a density of -1000, and fluid 2 has a density of -1500. However: 

int density = BlockFluidBase.getDensity(world, pos);

and

int density2 = BlockFluidBase.getDensity(world, pos2);

are both being set to -1000

 

any ideas why?

 

Edit: Also if fluid1 is on top of fluid2, they seem to be acting as the same block? When fluid two calls to see what is on top of it the check returns the density of the block above fluid1.

 

Edited by Aidiah
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.