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 have managed to create a new liquid just fine, it works as expected. The problem is that I'd like for it to be translucent just like water. 

 

I'm learning by looking at the code for water, and my attempt at making the liquid translucent can be seen below:

public static final Map<Fluid, RenderType> TYPES_BY_FLUID = Util.make(Maps.newHashMap(), (map) -> {
  final RenderType translucent = RenderType.getTranslucent();
  map.put(FluidRegistry.FLOWING_ACID.get(), translucent);
  map.put(FluidRegistry.ACID.get(), translucent);
});
@Mod.EventBusSubscriber(modid = Mod.MOD_ID, bus = Mod.EventBusSubscriber.Bus.MOD, value = Dist.CLIENT)
public class ClientSetup {
  @SubscribeEvent
  public static void clientSetup(final FMLClientSetupEvent event) {
    TYPES_BY_FLUID.forEach(RenderTypeLookup::setRenderLayer);
  }
}

 

With this code the liquid however becomes invisible instead. I haven't been able to find anything else about how water is rendered so I'm feeling a bit stuck.

Edited by OneHotEncoder
marked post as solved

  • Author

Solution:

Apparently there was nothing wrong with how I tried to render the fluid. The poblem was my FluidAttributes.Builder

 

I had naively though that it would be enough to specify the rgb values of the fluid, but you also have to specify the alpha value (specifically set it to 0xff).

 

Chaning my code from .color(0xa0e67a) to .color(0xffa0e67a) fixed the problem. Holy hell this took hours to find.

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.