Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

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.

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 by CreativeMasterBonin

  • Guest changed the title to [SOLVED] [1.20] Fluids Transparency Setup

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...

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.