Jump to content

Custom liquid particles and overlay


Jay Avery

Recommended Posts

I've made a custom fluid which extends BlockFluidClassic and has Material.WATER, because I want the player to swim and drown in it (which is working fine). But that also means that:

  • There's a blue overlay when the player is underwater
  • Blue splash and bubble particles spawn when swimming

I can't seem to pin down where these effects happen, or whether there's a way to cancel/override them. Can anyone suggest a way to change these effects, or simply point me to the code that controls them so I can investigate?

Link to comment
Share on other sites

Both of those are also handled by the entity being in the water Materia.WATER.

Or at least, the particles are. It's waaaay up in the Entity class, IIRC.

Edited by Draco18s

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Link to comment
Share on other sites

11 minutes ago, Jay Avery said:

There's a blue overlay when the player is underwater

There is a RenderBlockOverlayEvent that allows you to handle the overlay and I remember there was a PR to address the "in-liquid fog" color too.

Particles... Yeah, what Draco said. Hardcoded in the Entity::doWaterSplashEffect

Link to comment
Share on other sites

2 hours ago, Draco18s said:

Both of those are also handled by the entity being in the water Materia.WATER.

Or at least, the particles are. It's waaaay up in the Entity class, IIRC.

I knew that because they happened when I gave the block Material.WATER, I just wanted to know exactly where they happened to see if there was any way to change or cancel them with events.

1 hour ago, V0idWa1k3r said:

There is a RenderBlockOverlayEvent that allows you to handle the overlay and I remember there was a PR to address the "in-liquid fog" color too.

Particles... Yeah, what Draco said. Hardcoded in the Entity::doWaterSplashEffect

Thanks, that event is half of my solution. I don't see a method by that name in Entity, but I think I tracked down water particles to Entity#resetHeight, which gets called from Entity#handleWaterMovement. In any case, nothing I can cancel or interfere with - I guess I'll just put up with water bubbles.

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.