Skip to content

Commit

Permalink
Change liquid rendering in tanks: Make liquids brighter, and don't dr…
Browse files Browse the repository at this point in the history
…aw the flowing texture
  • Loading branch information
bonii-xx committed Aug 24, 2014
1 parent a270c30 commit 1daf7fa
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
11 changes: 11 additions & 0 deletions src/main/java/tconstruct/client/BlockSkinRenderHelper.java
Expand Up @@ -852,6 +852,11 @@ static boolean renderMetadataBlockWithColorMultiplier (Block block, int metadata
}

public static boolean renderLiquidBlock (IIcon stillIcon, IIcon flowingIcon, int x, int y, int z, RenderBlocks renderer, IBlockAccess world)
{
return renderLiquidBlock(stillIcon, flowingIcon, x, y, z, renderer, world, false);
}

public static boolean renderLiquidBlock (IIcon stillIcon, IIcon flowingIcon, int x, int y, int z, RenderBlocks renderer, IBlockAccess world, boolean extraBright)
{
Block block = Blocks.stone;
int var5 = block.colorMultiplier(world, x, y, z);
Expand All @@ -869,6 +874,12 @@ public static boolean renderLiquidBlock (IIcon stillIcon, IIcon flowingIcon, int
var8 = var11;
}

if(extraBright) {
var6 = Math.max(1.0f, var6 + 0.5f);
var7 = Math.max(1.0f, var7 + 0.5f);
var8 = Math.max(1.0f, var8 + 0.5f);
}

// safety
if(stillIcon == null) stillIcon = FluidRegistry.WATER.getStillIcon();
if(flowingIcon == null) flowingIcon = FluidRegistry.WATER.getFlowingIcon();
Expand Down
5 changes: 1 addition & 4 deletions src/main/java/tconstruct/smeltery/model/TankRender.java
Expand Up @@ -47,10 +47,7 @@ public boolean renderWorldBlock (IBlockAccess world, int x, int y, int z, Block
FluidStack liquid = logic.tank.getFluid();
renderer.setRenderBounds(0.001, 0.001, 0.001, 0.999, logic.getFluidAmountScaled(), 0.999);
Fluid fluid = liquid.getFluid();
if (fluid.canBePlacedInWorld())
BlockSkinRenderHelper.renderMetadataBlock(fluid.getBlock(), 0, x, y, z, renderer, world);
else
BlockSkinRenderHelper.renderLiquidBlock(fluid.getStillIcon(), fluid.getFlowingIcon(), x, y, z, renderer, world);
BlockSkinRenderHelper.renderLiquidBlock(fluid.getStillIcon(), fluid.getStillIcon(), x, y, z, renderer, world, true);

renderer.setRenderBounds(00, 0.001, 0.001, 0.999, logic.getFluidAmountScaled(), 0.999);
}
Expand Down

0 comments on commit 1daf7fa

Please sign in to comment.