Java Code Examples for net.minecraft.client.renderer.RenderBlocks#renderStandardBlockWithColorMultiplier()

The following examples show how to use net.minecraft.client.renderer.RenderBlocks#renderStandardBlockWithColorMultiplier() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: RendererGlasBlock.java    From bartworks with MIT License 5 votes vote down vote up
@Override
public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) {
    //renderer.setRenderBounds(0.001,0.001,0.001,0.999,0.999,0.999);
    renderer.renderStandardBlock(ItemRegistry.bw_fake_glasses, x, y, z);
    //renderer.setRenderBounds(0,0,0,1,1,1);
    renderer.renderStandardBlockWithColorMultiplier(block, x, y, z, ((BW_GlasBlocks) block).getColor(world.getBlockMetadata(x, y, z))[0] / 255f, ((BW_GlasBlocks) block).getColor(world.getBlockMetadata(x, y, z))[1] / 255f, ((BW_GlasBlocks) block).getColor(world.getBlockMetadata(x, y, z))[2] / 255f);
    return true;
}
 
Example 2
Source File: RenderFakeBlock.java    From Artifacts with MIT License 4 votes vote down vote up
@Override
public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) {
	float f = 0.03125F;
	float xn = 0F;
	float xp = 1F;
	float yn = 0F;
	float yp = 1F;
	float zn = 0F;
	float zp = 1F;
	if(!world.getBlock(x-1, y, z).isOpaqueCube()) {
		if(world.getBlock(x-1, y, z) != block)
			xn = f;
	}
	if(!world.getBlock(x+1, y, z).isOpaqueCube()) {
		if(world.getBlock(x+1, y, z) != block)
			xp = 1F-f;
	}
	if(!world.getBlock(x, y-1, z).isOpaqueCube()) {
		if(world.getBlock(x, y-1, z) != block)
			yn = f;
	}
	if(!world.getBlock(x, y+1, z).isOpaqueCube()) {
		if(world.getBlock(x, y+1, z) != block)
			yp = 1F-f;
	}
	if(!world.getBlock(x, y, z-1).isOpaqueCube()) {
		if(world.getBlock(x, y, z-1) != block)
			zn = f;
	}
	if(!world.getBlock(x, y, z+1).isOpaqueCube()) {
		if(world.getBlock(x, y, z+1) != block)
			zp = 1F-f;
	}
	//block.setBlockBounds(xn, yn, zn, xp, yp, zp);
	renderer.setRenderBounds(xn, yn, zn, xp, yp, zp);
	
	int l = block.colorMultiplier(world, x, y, z);
       float f0 = (float)(l >> 16 & 255) / 255.0F;
       float f1 = (float)(l >> 8 & 255) / 255.0F;
       float f2 = (float)(l & 255) / 255.0F;

       if (EntityRenderer.anaglyphEnable)
       {
           float f3 = (f * 30.0F + f1 * 59.0F + f2 * 11.0F) / 100.0F;
           float f4 = (f * 30.0F + f1 * 70.0F) / 100.0F;
           float f5 = (f * 30.0F + f2 * 70.0F) / 100.0F;
           f0 = f3;
           f1 = f4;
           f2 = f5;
       }
       
       //if() {
       /*f0 *= 1.5;
       f1 *= 1.5;
       f2 *= 1.5;*/
       //}

       return renderer.renderStandardBlockWithColorMultiplier(block, x, y, z, f0, f1, f2);
}