Posted July 18, 20232 yr I've just been working on adding new fluids to the game, when I came across a problem. The fluids have textures, models, buckets, and proper names and properties, however, I can't add transparency. Is there a specific method I am missing in my setup for the fluids that allows transparency in the model itself? I want it to be transparent like water is. The specific fluid that needs transparency is PurifyingWater. Here is the FluidType class: https://pastebin.com/k9i3UBzB Here is the Fluid class: https://pastebin.com/aUgkZz8E Here is the Fluid Registry (the deferred registers aren't used in this class): https://pastebin.com/DpKNbthT Here is the Block class for the fluid: https://pastebin.com/xWmje9CJ Another issue that doesn't have to be addressed is: custom overlay textures for fluid underwater. If anyone has the exact answer to add transparency to custom fluids, then thanks.
July 19, 20232 yr OK here is the solution: In your FluidType definition, remember to add a getTintColor() method and return a hex value color formatted ARGB (alpha, red, green, blue). Then, in your main mod class (or whatever is your 'rendering' class), set the ItemBlockRenderType layer for the fluids registered (flowing and still) to whatever valid layer (exactly like the old way of setting the layer for glass like blocks or other transparent textured blocks). In the end, I got my transparent water-like block. Cool! Hope this solves other people's issues. Edited July 19, 20232 yr by CreativeMasterBonin
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.