From df67af26acff178ee25d9a09d8600b3d76361b97 Mon Sep 17 00:00:00 2001 From: Richard Freimer Date: Sun, 7 Apr 2019 19:16:53 -0400 Subject: [PATCH] When creating fluids from gases set their alpha value to no transparency (#5353) * When creating fluids from gases set their alpha value to no transparency Fixes https://github.com/mekanica/mekanica/issues/157 * Remove unneeded bitshifting --- src/main/java/mekanism/api/gas/Gas.java | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/main/java/mekanism/api/gas/Gas.java b/src/main/java/mekanism/api/gas/Gas.java index 62365c621..549da3106 100644 --- a/src/main/java/mekanism/api/gas/Gas.java +++ b/src/main/java/mekanism/api/gas/Gas.java @@ -54,7 +54,7 @@ public class Gas { */ public Gas(String s, int t) { this(s, "mekanism:blocks/liquid/liquid"); - tint = t; + setTint(t); } /** @@ -65,7 +65,7 @@ public class Gas { iconLocation = f.getStill(); fluid = f; from_fluid = true; - tint = f.getColor() & 0xFFFFFF; + setTint(f.getColor() & 0xFFFFFF); } /** @@ -268,7 +268,13 @@ public class Gas { public Gas registerFluid(String name) { if (fluid == null) { if (FluidRegistry.getFluid(name) == null) { - fluid = new Fluid(name, getIcon(), getIcon(), getTint()); + int tint = getTint(); + //Fluids use ARGB so make sure that we are not using a fully transparent tint. + // This fixes issues with some mods rendering our fluids as invisible + if ((tint & 0xFF000000) == 0) { + tint = 0xFF000000 | tint; + } + fluid = new Fluid(name, getIcon(), getIcon(), tint); FluidRegistry.registerFluid(fluid); } else { fluid = FluidRegistry.getFluid(name);