commit
a5be4d79c4
5 changed files with 24 additions and 2 deletions
|
@ -182,6 +182,13 @@ public abstract class GuiAdvancedInterface extends GuiBuildCraft {
|
|||
super(x, y);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawSprite(int cornerX, int cornerY) {
|
||||
if(fluid != null)
|
||||
FluidRenderer.colorFluid(new FluidStack(fluid,100)); // Lacks FluidStack to properly function Please revise.
|
||||
super.drawSprite(cornerX, cornerY);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Icon getIcon() {
|
||||
return FluidRenderer.getFluidTexture(fluid, false);
|
||||
|
|
|
@ -75,6 +75,15 @@ public class FluidRenderer {
|
|||
public static ResourceLocation getFluidSheet(Fluid liquid) {
|
||||
return BLOCK_TEXTURE;
|
||||
}
|
||||
|
||||
public static void colorFluid(FluidStack fluidstack){
|
||||
if(fluidstack== null) return;
|
||||
int color = fluidstack.getFluid().getColor(fluidstack);
|
||||
float red = (float) (color >> 16 & 255) / 255.0F;
|
||||
float green = (float) (color >> 8 & 255) / 255.0F;
|
||||
float blue = (float) (color & 255) / 255.0F;
|
||||
GL11.glColor4f(red, green, blue, 1);
|
||||
}
|
||||
|
||||
public static int[] getFluidDisplayLists(FluidStack fluidStack, World world, boolean flowing) {
|
||||
if (fluidStack == null) {
|
||||
|
|
|
@ -182,6 +182,7 @@ public class RenderRefinery extends TileEntitySpecialRenderer implements IInvent
|
|||
|
||||
if (list1 != null) {
|
||||
func_110628_a(FluidRenderer.getFluidSheet(liquid1));
|
||||
FluidRenderer.colorFluid(liquid1);
|
||||
GL11.glCallList(list1[(int) ((float) liquid1.amount / (float) TileRefinery.LIQUID_PER_SLOT * (FluidRenderer.DISPLAY_STAGES - 1))]);
|
||||
}
|
||||
}
|
||||
|
@ -193,6 +194,7 @@ public class RenderRefinery extends TileEntitySpecialRenderer implements IInvent
|
|||
GL11.glPushMatrix();
|
||||
GL11.glTranslatef(0, 0, 1);
|
||||
func_110628_a(FluidRenderer.getFluidSheet(liquid2));
|
||||
FluidRenderer.colorFluid(liquid2);
|
||||
GL11.glCallList(list2[(int) ((float) liquid2.amount / (float) TileRefinery.LIQUID_PER_SLOT * (FluidRenderer.DISPLAY_STAGES - 1))]);
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
|
@ -206,6 +208,7 @@ public class RenderRefinery extends TileEntitySpecialRenderer implements IInvent
|
|||
GL11.glPushMatrix();
|
||||
GL11.glTranslatef(1, 0, 0.5F);
|
||||
func_110628_a(FluidRenderer.getFluidSheet(liquidResult));
|
||||
FluidRenderer.colorFluid(liquidResult);
|
||||
GL11.glCallList(list3[(int) ((float) liquidResult.amount / (float) TileRefinery.LIQUID_PER_SLOT * (FluidRenderer.DISPLAY_STAGES - 1))]);
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
|
|
|
@ -39,7 +39,8 @@ public class RenderTank extends TileEntitySpecialRenderer {
|
|||
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
|
||||
|
||||
func_110628_a(FluidRenderer.getFluidSheet(liquid));
|
||||
|
||||
FluidRenderer.colorFluid(liquid);
|
||||
|
||||
GL11.glTranslatef((float) x + 0.125F, (float) y, (float) z + 0.125F);
|
||||
GL11.glScalef(0.75F, 0.999F, 0.75F);
|
||||
|
||||
|
|
|
@ -368,6 +368,7 @@ public class RenderPipe extends TileEntitySpecialRenderer {
|
|||
default:
|
||||
}
|
||||
func_110628_a(TextureMap.field_110575_b);
|
||||
FluidRenderer.colorFluid(liquid);
|
||||
GL11.glCallList(list);
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
|
@ -382,7 +383,8 @@ public class RenderPipe extends TileEntitySpecialRenderer {
|
|||
int stage = (int) ((float) liquid.amount / (float) (trans.getCapacity()) * (LIQUID_STAGES - 1));
|
||||
|
||||
func_110628_a(TextureMap.field_110575_b);
|
||||
|
||||
FluidRenderer.colorFluid(liquid);
|
||||
|
||||
if (above) {
|
||||
GL11.glCallList(d.centerVertical[stage]);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue