OneHotEncoder Posted May 12, 2020 Posted May 12, 2020 (edited) 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 May 13, 2020 by OneHotEncoder marked post as solved Quote
OneHotEncoder Posted May 13, 2020 Author Posted May 13, 2020 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. Quote
Recommended Posts
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.