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

The following examples show how to use net.minecraft.client.renderer.RenderBlocks#renderFaceXPos() . 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: BlockChorusFlowerRender.java    From Et-Futurum with The Unlicense 6 votes vote down vote up
private void renderCube(RenderBlocks renderer, Block block, int meta) {
	Tessellator tessellator = Tessellator.instance;
	tessellator.startDrawingQuads();
	tessellator.setNormal(0.0F, -1.0F, 0.0F);
	renderer.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderer.getBlockIconFromSideAndMetadata(block, 0, meta));
	tessellator.setNormal(0.0F, 1.0F, 0.0F);
	renderer.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderer.getBlockIconFromSideAndMetadata(block, 1, meta));
	tessellator.setNormal(0.0F, 0.0F, -1.0F);
	renderer.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderer.getBlockIconFromSideAndMetadata(block, 2, meta));
	tessellator.setNormal(0.0F, 0.0F, 1.0F);
	renderer.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderer.getBlockIconFromSideAndMetadata(block, 3, meta));
	tessellator.setNormal(-1.0F, 0.0F, 0.0F);
	renderer.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderer.getBlockIconFromSideAndMetadata(block, 4, meta));
	tessellator.setNormal(1.0F, 0.0F, 0.0F);
	renderer.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderer.getBlockIconFromSideAndMetadata(block, 5, meta));
	tessellator.draw();
}
 
Example 2
Source File: ModelCertusTank.java    From ExtraCells1 with MIT License 5 votes vote down vote up
public void renderOuterBlock(Block block, int x, int y, int z, RenderBlocks renderer, IBlockAccess world)
{

	Tessellator tessellator = Tessellator.instance;
	boolean tankUp = world.getBlockTileEntity(x, y + 1, z) instanceof TileEntityCertusTank;
	boolean tankDown = world.getBlockTileEntity(x, y - 1, z) instanceof TileEntityCertusTank;
	int meta = 0;
	if (tankUp && tankDown)
		meta = 3;
	else if (tankUp)
		meta = 2;
	else if (tankDown)
		meta = 1;
	if (!tankDown)
	{
		tessellator.setNormal(0.0F, -1F, 0.0F);
		renderer.renderFaceYNeg(block, x, y, z, block.getIcon(0, 0));
	}
	if (!(tankUp))
	{
		tessellator.setNormal(0.0F, 1.0F, 0.0F);
		renderer.renderFaceYPos(block, x, y, z, block.getIcon(1, 0));
	}

	Icon sideIcon = block.getIcon(3, meta);
	tessellator.setNormal(0.0F, 0.0F, -1F);
	renderer.renderFaceZNeg(block, x, y, z, sideIcon);
	tessellator.setNormal(0.0F, 0.0F, 1.0F);
	renderer.renderFaceZPos(block, x, y, z, sideIcon);
	tessellator.setNormal(-1F, 0.0F, 0.0F);
	renderer.renderFaceXNeg(block, x, y, z, sideIcon);
	tessellator.setNormal(1.0F, 0.0F, 0.0F);
	renderer.renderFaceXPos(block, x, y, z, sideIcon);

}
 
Example 3
Source File: RotorSimpleRenderer.java    From BigReactors with MIT License 5 votes vote down vote up
public static void renderBlade(RenderBlocks renderer, int x, int y, int z, Block block, int metadata, ForgeDirection rotorDir) {
	if(rotorDir == ForgeDirection.UNKNOWN) {
		rotorDir = ForgeDirection.UP;
	}
	
	double xMin, yMin, zMin, xMax, yMax, zMax;
	xMin = yMin = zMin = 0D;
	xMax = yMax = zMax = 1D;
	
	if(rotorDir.offsetX != 0) {
		xMin = 0.45D;
		xMax = 0.55D;
	}
	else if(rotorDir.offsetY != 0) {
		yMin = 0.45D;
		yMax = 0.55D;
	}
	else if(rotorDir.offsetZ != 0) {
		zMin = 0.45D;
		zMax = 0.55D;
	}
	
       Tessellator.instance.setColorRGBA(255, 255, 255, 255);
       renderer.setRenderBoundsFromBlock(block);
       renderer.setOverrideBlockTexture(null);
	
       renderer.setRenderBounds(xMin, yMin, zMin, xMax, yMax, zMax);
       renderer.renderFaceYNeg(block, x, y, z, renderer.getBlockIconFromSideAndMetadata(block, 0, metadata));
       renderer.setRenderBounds(xMin, yMin, zMin, xMax, yMax, zMax);
       renderer.renderFaceYPos(block, x, y, z, renderer.getBlockIconFromSideAndMetadata(block, 1, metadata));
       renderer.setRenderBounds(xMin, yMin, zMin, xMax, yMax, zMax);
       renderer.renderFaceZNeg(block, x, y, z, renderer.getBlockIconFromSideAndMetadata(block, 2, metadata));
       renderer.setRenderBounds(xMin, yMin, zMin, xMax, yMax, zMax);
       renderer.renderFaceZPos(block, x, y, z, renderer.getBlockIconFromSideAndMetadata(block, 3, metadata));
       renderer.setRenderBounds(xMin, yMin, zMin, xMax, yMax, zMax);
       renderer.renderFaceXNeg(block, x, y, z, renderer.getBlockIconFromSideAndMetadata(block, 4, metadata));
       renderer.setRenderBounds(xMin, yMin, zMin, xMax, yMax, zMax);
       renderer.renderFaceXPos(block, x, y, z, renderer.getBlockIconFromSideAndMetadata(block, 5, metadata));
       renderer.setRenderBounds(0D, 0D, 0D, 1D, 1D, 1D);
}
 
Example 4
Source File: Drawing.java    From Chisel with GNU General Public License v2.0 5 votes vote down vote up
public static void drawBlock(Block block, int meta, RenderBlocks renderer)
{
    Tessellator tessellator = Tessellator.instance;

    tessellator.startDrawingQuads();
    tessellator.setNormal(0.0F, -1.0F, 0.0F);
    renderer.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, block.getIcon(0, meta));
    tessellator.draw();
    tessellator.startDrawingQuads();
    tessellator.setNormal(0.0F, 1.0F, 0.0F);
    renderer.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, block.getIcon(1, meta));
    tessellator.draw();
    tessellator.startDrawingQuads();
    tessellator.setNormal(0.0F, 0.0F, -1.0F);
    renderer.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, block.getIcon(2, meta));
    tessellator.draw();
    tessellator.startDrawingQuads();
    tessellator.setNormal(0.0F, 0.0F, 1.0F);
    renderer.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, block.getIcon(3, meta));
    tessellator.draw();
    tessellator.startDrawingQuads();
    tessellator.setNormal(-1.0F, 0.0F, 0.0F);
    renderer.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, block.getIcon(4, meta));
    tessellator.draw();
    tessellator.startDrawingQuads();
    tessellator.setNormal(1.0F, 0.0F, 0.0F);
    renderer.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, block.getIcon(5, meta));
    tessellator.draw();
}
 
Example 5
Source File: Drawing.java    From Chisel with GNU General Public License v2.0 5 votes vote down vote up
public static void drawBlock(Block block, IIcon icon, RenderBlocks renderer)
{
    Tessellator tessellator = Tessellator.instance;

    tessellator.startDrawingQuads();
    tessellator.setNormal(0.0F, -1.0F, 0.0F);
    renderer.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, icon);
    tessellator.draw();
    tessellator.startDrawingQuads();
    tessellator.setNormal(0.0F, 1.0F, 0.0F);
    renderer.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, icon);
    tessellator.draw();
    tessellator.startDrawingQuads();
    tessellator.setNormal(0.0F, 0.0F, -1.0F);
    renderer.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, icon);
    tessellator.draw();
    tessellator.startDrawingQuads();
    tessellator.setNormal(0.0F, 0.0F, 1.0F);
    renderer.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, icon);
    tessellator.draw();
    tessellator.startDrawingQuads();
    tessellator.setNormal(-1.0F, 0.0F, 0.0F);
    renderer.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, icon);
    tessellator.draw();
    tessellator.startDrawingQuads();
    tessellator.setNormal(1.0F, 0.0F, 0.0F);
    renderer.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, icon);
    tessellator.draw();
}
 
Example 6
Source File: ThinLogFenceRenderer.java    From GardenCollection with MIT License 5 votes vote down vote up
private void renderPostAtOrigin (BlockThinLogFence block, int metadata, RenderBlocks renderer, Tessellator tessellator) {
    tessellator.startDrawingQuads();
    tessellator.setNormal(0.0F, -1.0F, 0.0F);
    renderer.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderer.getBlockIconFromSideAndMetadata(block, 0, metadata));
    tessellator.draw();
    tessellator.startDrawingQuads();
    tessellator.setNormal(0.0F, 1.0F, 0.0F);
    renderer.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderer.getBlockIconFromSideAndMetadata(block, 1, metadata));
    tessellator.draw();
    tessellator.startDrawingQuads();
    tessellator.setNormal(0.0F, 0.0F, -1.0F);
    renderer.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderer.getBlockIconFromSideAndMetadata(block, 2, metadata));
    renderer.renderFaceZNeg(block, 0, 0, .5f, block.getSideIcon());
    tessellator.draw();
    tessellator.startDrawingQuads();
    tessellator.setNormal(0.0F, 0.0F, 1.0F);
    renderer.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderer.getBlockIconFromSideAndMetadata(block, 3, metadata));
    renderer.renderFaceZPos(block, 0, 0, -.5f, block.getSideIcon());
    tessellator.draw();
    tessellator.startDrawingQuads();
    tessellator.setNormal(-1.0F, 0.0F, 0.0F);
    renderer.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderer.getBlockIconFromSideAndMetadata(block, 4, metadata));
    renderer.renderFaceXNeg(block, .5f, 0, 0, block.getSideIcon());
    tessellator.draw();
    tessellator.startDrawingQuads();
    tessellator.setNormal(1.0F, 0.0F, 0.0F);
    renderer.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderer.getBlockIconFromSideAndMetadata(block, 5, metadata));
    renderer.renderFaceXPos(block, -.5f, 0, 0, block.getSideIcon());
    tessellator.draw();
}
 
Example 7
Source File: FlowerLeafRenderer.java    From GardenCollection with MIT License 5 votes vote down vote up
private boolean renderWorldBlock (IBlockAccess world, int x, int y, int z, BlockFlowerLeaves block, int modelId, RenderBlocks renderer) {
    renderer.renderStandardBlock(block, x, y, z);

    Tessellator tessellator = Tessellator.instance;
    tessellator.setBrightness(block.getMixedBrightnessForBlock(world, x, y, z));
    tessellator.setColorOpaque_F(1f, 1f, 1f);

    int meta = world.getBlockMetadata(x, y, z);
    float offset = .03125f;
    IIcon icon = block.getFlowerIcon(world, x, y, z, meta, 1);
    if (icon != null)
        renderer.renderFaceYPos(block, x, y + offset, z, icon);

    icon = block.getFlowerIcon(world, x, y, z, meta, 2);
    if (icon != null)
        renderer.renderFaceZNeg(block, x, y, z - offset, icon);

    icon = block.getFlowerIcon(world, x, y, z, meta, 3);
    if (icon != null)
        renderer.renderFaceZPos(block, x, y, z + offset, icon);

    icon = block.getFlowerIcon(world, x, y, z, meta, 4);
    if (icon != null)
        renderer.renderFaceXNeg(block, x - offset, y, z, icon);

    icon = block.getFlowerIcon(world, x, y, z, meta, 5);
    if (icon != null)
        renderer.renderFaceXPos(block, x + offset, y, z, icon);

    return true;
}
 
Example 8
Source File: ModelCertusTank.java    From ExtraCells1 with MIT License 5 votes vote down vote up
public void renderInnerBlock(Block block, int x, int y, int z, RenderBlocks renderer, IBlockAccess world)
{
	Tessellator tessellator = Tessellator.instance;
	boolean tankUp = world.getBlockTileEntity(x, y + 1, z) instanceof TileEntityCertusTank;
	boolean tankDown = world.getBlockTileEntity(x, y - 1, z) instanceof TileEntityCertusTank;
	int meta = 0;
	if (tankUp && tankDown)
		meta = 3;
	else if (tankUp)
		meta = 2;
	else if (tankDown)
		meta = 1;
	if (!tankDown)
	{
		tessellator.setNormal(0.0F, -1F, 0.0F);
		renderer.renderFaceYNeg(block, x, y + 0.001D, z, block.getIcon(0, 0));
	}
	if (!(tankUp))
	{
		tessellator.setNormal(0.0F, 1.0F, 0.0F);
		renderer.renderFaceYPos(block, x, y - 0.001D, z, block.getIcon(1, 0));
	}
	Icon sideIcon = block.getIcon(3, meta);
	tessellator.setNormal(0.0F, 0.0F, -1F);
	renderer.renderFaceZNeg(block, x, y, z + 0.001D, sideIcon);
	tessellator.setNormal(0.0F, 0.0F, 1.0F);
	renderer.renderFaceZPos(block, x, y, z - 0.001D, sideIcon);
	tessellator.setNormal(-1F, 0.0F, 0.0F);
	renderer.renderFaceXNeg(block, x + 0.001D, y, z, sideIcon);
	tessellator.setNormal(1.0F, 0.0F, 0.0F);
	renderer.renderFaceXPos(block, x - 0.001D, y, z, sideIcon);

}
 
Example 9
Source File: QCraftProxyClient.java    From qcraft-mod with Apache License 2.0 5 votes vote down vote up
private void renderInventoryQBlock( RenderBlocks renderblocks, BlockQBlock block, int type, BlockQBlock.Appearance appearance )
{
    Tessellator tessellator = Tessellator.instance;
    tessellator.startDrawingQuads();
    bindColor( block.getColorForType( 0, type ) );
    tessellator.setNormal( 0.0F, -1F, 0.0F );
    renderblocks.renderFaceYNeg( block, 0.0D, 0.0D, 0.0D, block.getIconForType( 0, type, appearance ) );
    tessellator.draw();

    tessellator.startDrawingQuads();
    bindColor( block.getColorForType( 1, type ) );
    tessellator.setNormal( 0.0F, 1.0F, 0.0F );
    renderblocks.renderFaceYPos( block, 0.0D, 0.0D, 0.0D, block.getIconForType( 1, type, appearance ) );
    tessellator.draw();

    tessellator.startDrawingQuads();
    bindColor( block.getColorForType( 2, type ) );
    tessellator.setNormal( 0.0F, 0.0F, -1F );
    renderblocks.renderFaceZNeg( block, 0.0D, 0.0D, 0.0D, block.getIconForType( 2, type, appearance ) );
    tessellator.draw();

    tessellator.startDrawingQuads();
    bindColor( block.getColorForType( 3, type ) );
    tessellator.setNormal( 0.0F, 0.0F, 1.0F );
    renderblocks.renderFaceZPos( block, 0.0D, 0.0D, 0.0D, block.getIconForType( 3, type, appearance ) );
    tessellator.draw();

    tessellator.startDrawingQuads();
    bindColor( block.getColorForType( 4, type ) );
    tessellator.setNormal( -1F, 0.0F, 0.0F );
    renderblocks.renderFaceXNeg( block, 0.0D, 0.0D, 0.0D, block.getIconForType( 4, type, appearance ) );
    tessellator.draw();

    tessellator.startDrawingQuads();
    bindColor( block.getColorForType( 5, type ) );
    tessellator.setNormal( 1.0F, 0.0F, 0.0F );
    renderblocks.renderFaceXPos( block, 0.0D, 0.0D, 0.0D, block.getIconForType( 5, type, appearance ) );
    tessellator.draw();
}
 
Example 10
Source File: BlockRenderingHandler.java    From Gadomancy with GNU Lesser General Public License v3.0 5 votes vote down vote up
protected void renderFace(int side, RenderBlocks renderer, Block block, int x, int y, int z, IIcon icon) {
    switch (side) {
        case 0: renderer.renderFaceYNeg(block, x, y, z, icon); break;
        case 1: renderer.renderFaceYPos(block, x, y, z, icon); break;
        case 2: renderer.renderFaceZNeg(block, x, y, z, icon); break;
        case 3: renderer.renderFaceZPos(block, x, y, z, icon); break;
        case 4: renderer.renderFaceXNeg(block, x, y, z, icon); break;
        case 5: renderer.renderFaceXPos(block, x, y, z, icon); break;
    }
}
 
Example 11
Source File: BlockRenderingHandler.java    From Gadomancy with GNU Lesser General Public License v3.0 5 votes vote down vote up
protected void renderAllFaces(RenderBlocks renderer, Block block, int x, int y, int z, IIcon icon) {
    renderer.renderFaceYNeg(block, x, y, z, icon);
    renderer.renderFaceYPos(block, x, y, z, icon);
    renderer.renderFaceZNeg(block, x, y, z, icon);
    renderer.renderFaceZPos(block, x, y, z, icon);
    renderer.renderFaceXNeg(block, x, y, z, icon);
    renderer.renderFaceXPos(block, x, y, z, icon);
}
 
Example 12
Source File: RendererGlasBlock.java    From bartworks with MIT License 5 votes vote down vote up
@Override
public void renderInventoryBlock(Block block, int metadata, int modelId, RenderBlocks renderer) {
    Tessellator tessellator = Tessellator.instance;
    block.setBlockBoundsForItemRender();
    renderer.setRenderBoundsFromBlock(block);
    GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F);
    GL11.glTranslatef(-0.5F, -0.5F, -0.5F);
    tessellator.startDrawingQuads();
    tessellator.setNormal(0.0F, -1.0F, 0.0F);
    renderer.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderer.getBlockIconFromSideAndMetadata(block, 0, metadata));
    tessellator.draw();
    tessellator.startDrawingQuads();
    tessellator.setNormal(0.0F, 1.0F, 0.0F);
    renderer.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderer.getBlockIconFromSideAndMetadata(block, 1, metadata));
    tessellator.draw();
    tessellator.startDrawingQuads();
    tessellator.setNormal(0.0F, 0.0F, -1.0F);
    renderer.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderer.getBlockIconFromSideAndMetadata(block, 2, metadata));
    tessellator.draw();
    tessellator.startDrawingQuads();
    tessellator.setNormal(0.0F, 0.0F, 1.0F);
    renderer.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderer.getBlockIconFromSideAndMetadata(block, 3, metadata));
    tessellator.draw();
    tessellator.startDrawingQuads();
    tessellator.setNormal(-1.0F, 0.0F, 0.0F);
    renderer.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderer.getBlockIconFromSideAndMetadata(block, 4, metadata));
    tessellator.draw();
    tessellator.startDrawingQuads();
    tessellator.setNormal(1.0F, 0.0F, 0.0F);
    renderer.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderer.getBlockIconFromSideAndMetadata(block, 5, metadata));
    tessellator.draw();
    GL11.glTranslatef(0.5F, 0.5F, 0.5F);
}
 
Example 13
Source File: TileEntityEndRodRenderer.java    From Et-Futurum with The Unlicense 4 votes vote down vote up
public static void renderRod(RenderBlocks renderer, Block block, int meta) {
	Tessellator tessellator = Tessellator.instance;

	double x = 7 / 16.0;
	double y = 0;
	double z = 7 / 16.0;
	renderer.setRenderBounds(0, 1 / 16F, 0, 2 / 16F, 1, 2 / 16F);
	tessellator.startDrawingQuads();
	tessellator.setNormal(0.0F, -1.0F, 0.0F);
	renderer.renderFaceYNeg(block, x, y, z, renderer.getBlockIconFromSideAndMetadata(block, 0, meta));
	tessellator.setNormal(0.0F, 1.0F, 0.0F);
	renderer.renderFaceYPos(block, x, y, z, renderer.getBlockIconFromSideAndMetadata(block, 1, meta));
	tessellator.setNormal(0.0F, 0.0F, -1.0F);
	renderer.renderFaceZNeg(block, x, y, z, renderer.getBlockIconFromSideAndMetadata(block, 2, meta));
	tessellator.setNormal(0.0F, 0.0F, 1.0F);
	renderer.renderFaceZPos(block, x, y, z, renderer.getBlockIconFromSideAndMetadata(block, 3, meta));
	tessellator.setNormal(-1.0F, 0.0F, 0.0F);
	renderer.renderFaceXNeg(block, x, y, z, renderer.getBlockIconFromSideAndMetadata(block, 4, meta));
	tessellator.setNormal(1.0F, 0.0F, 0.0F);
	renderer.renderFaceXPos(block, x, y, z, renderer.getBlockIconFromSideAndMetadata(block, 5, meta));
	tessellator.draw();

	x = 4 / 16.0;
	y = 0;
	z = 4 / 16.0;
	renderer.setRenderBounds(2 / 16F, 0, 2 / 16F, 6 / 16F, 1 / 16F, 6 / 16F);
	tessellator.startDrawingQuads();
	tessellator.setNormal(0.0F, -1.0F, 0.0F);
	renderer.renderFaceYNeg(block, x, y, z, renderer.getBlockIconFromSideAndMetadata(block, 0, meta));
	tessellator.setNormal(0.0F, 1.0F, 0.0F);
	renderer.renderFaceYPos(block, x, y, z, renderer.getBlockIconFromSideAndMetadata(block, 1, meta));
	y = -13 / 16.0;
	renderer.setRenderBounds(2 / 16F, 13 / 16F, 2 / 16F, 6 / 16F, 14 / 16F, 6 / 16F);
	tessellator.setNormal(0.0F, 0.0F, -1.0F);
	renderer.renderFaceZNeg(block, x, y, z, renderer.getBlockIconFromSideAndMetadata(block, 2, meta));
	tessellator.setNormal(0.0F, 0.0F, 1.0F);
	renderer.renderFaceZPos(block, x, y, z, renderer.getBlockIconFromSideAndMetadata(block, 3, meta));
	tessellator.setNormal(-1.0F, 0.0F, 0.0F);
	renderer.renderFaceXNeg(block, x, y, z, renderer.getBlockIconFromSideAndMetadata(block, 4, meta));
	tessellator.setNormal(1.0F, 0.0F, 0.0F);
	renderer.renderFaceXPos(block, x, y, z, renderer.getBlockIconFromSideAndMetadata(block, 5, meta));
	tessellator.draw();
}
 
Example 14
Source File: ItemRendererCertusTank.java    From ExtraCells1 with MIT License 4 votes vote down vote up
public void renderItem(ItemRenderType type, ItemStack item, Object... data)
{
	Minecraft.getMinecraft().renderEngine.bindTexture(new ResourceLocation("extracells", "textures/blocks/texmap_tank.png"));
	GL11.glPushMatrix();
	GL11.glTranslatef(0.5F, 0.5F, 0.5F);
	GL11.glScalef(1.0F, -1F, -1F);
	model.render(0.0625f);
	GL11.glScalef(1.0F, -1F, 1.0F);
	model.render(0.0625f);

	if (item != null && item.hasTagCompound())
	{
		FluidStack storedFluid = FluidStack.loadFluidStackFromNBT(item.getTagCompound().getCompoundTag("tileEntity"));
		int tankCapacity = 32000;

		if (storedFluid != null && storedFluid.getFluid() != null)
		{
			Icon fluidIcon = storedFluid.getFluid().getIcon();

			Tessellator tessellator = Tessellator.instance;
			RenderBlocks renderer = new RenderBlocks();

			GL11.glScalef(1.0F, 1.0F, -1.0F);
			renderer.setRenderBounds(0.08F, 0.001F, 0.08F, 0.92, (float) storedFluid.amount / (float) tankCapacity * 0.999F, 0.92F);
			Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.locationBlocksTexture);
			GL11.glTranslatef(-0.5F, -0.5F, -0.5F);

			GL11.glPushAttrib(GL11.GL_ENABLE_BIT);
			GL11.glEnable(GL11.GL_CULL_FACE);
			GL11.glDisable(GL11.GL_LIGHTING);
			GL11.glEnable(GL11.GL_BLEND);
			GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);

			tessellator.startDrawingQuads();
			tessellator.setNormal(0.0F, -1F, 0.0F);
			renderer.renderFaceYNeg(Block.blocksList[FluidRegistry.WATER.getBlockID()], 0.0D, 0.0D, 0.0D, fluidIcon);
			tessellator.draw();
			tessellator.startDrawingQuads();
			tessellator.setNormal(0.0F, 1.0F, 0.0F);
			renderer.renderFaceYPos(Block.blocksList[FluidRegistry.WATER.getBlockID()], 0.0D, 0.0D, 0.0D, fluidIcon);
			tessellator.draw();
			tessellator.startDrawingQuads();
			tessellator.setNormal(0.0F, 0.0F, -1F);
			renderer.renderFaceZNeg(Block.blocksList[FluidRegistry.WATER.getBlockID()], 0.0D, 0.0D, 0.0D, fluidIcon);
			tessellator.draw();
			tessellator.startDrawingQuads();
			tessellator.setNormal(0.0F, 0.0F, 1.0F);
			renderer.renderFaceZPos(Block.blocksList[FluidRegistry.WATER.getBlockID()], 0.0D, 0.0D, 0.0D, fluidIcon);
			tessellator.draw();
			tessellator.startDrawingQuads();
			tessellator.setNormal(-1F, 0.0F, 0.0F);
			renderer.renderFaceXNeg(Block.blocksList[FluidRegistry.WATER.getBlockID()], 0.0D, 0.0D, 0.0D, fluidIcon);
			tessellator.draw();
			tessellator.startDrawingQuads();
			tessellator.setNormal(1.0F, 0.0F, 0.0F);
			renderer.renderFaceXPos(Block.blocksList[FluidRegistry.WATER.getBlockID()], 0.0D, 0.0D, 0.0D, fluidIcon);
			tessellator.draw();

			GL11.glPopAttrib();
		}
	}

	GL11.glPopMatrix();
}
 
Example 15
Source File: BlockSlimeBlockRender.java    From Et-Futurum with The Unlicense 4 votes vote down vote up
@Override
public void renderInventoryBlock(Block block, int meta, int modelID, RenderBlocks renderer) {
	Tessellator tessellator = Tessellator.instance;
	OpenGLHelper.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
	OpenGLHelper.enableBlend();
	OpenGLHelper.translate(-0.5F, -0.5F, -0.5F);

	float f = 0.0625F;
	renderer.setRenderBounds(f * 3, f * 3, f * 3, f * 13, f * 13, f * 13);
	tessellator.startDrawingQuads();
	tessellator.setNormal(0.0F, -1.0F, 0.0F);
	renderer.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderer.getBlockIconFromSideAndMetadata(block, 0, meta));
	tessellator.setNormal(0.0F, 1.0F, 0.0F);
	renderer.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderer.getBlockIconFromSideAndMetadata(block, 1, meta));
	tessellator.setNormal(0.0F, 0.0F, -1.0F);
	renderer.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderer.getBlockIconFromSideAndMetadata(block, 2, meta));
	tessellator.setNormal(0.0F, 0.0F, 1.0F);
	renderer.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderer.getBlockIconFromSideAndMetadata(block, 3, meta));
	tessellator.setNormal(-1.0F, 0.0F, 0.0F);
	renderer.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderer.getBlockIconFromSideAndMetadata(block, 4, meta));
	tessellator.setNormal(1.0F, 0.0F, 0.0F);
	renderer.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderer.getBlockIconFromSideAndMetadata(block, 5, meta));
	tessellator.draw();

	renderer.setRenderBounds(0, 0, 0, 1, 1, 1);
	tessellator.startDrawingQuads();
	tessellator.setNormal(0.0F, -1.0F, 0.0F);
	renderer.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderer.getBlockIconFromSideAndMetadata(block, 0, meta));
	tessellator.setNormal(0.0F, 1.0F, 0.0F);
	renderer.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderer.getBlockIconFromSideAndMetadata(block, 1, meta));
	tessellator.setNormal(0.0F, 0.0F, -1.0F);
	renderer.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderer.getBlockIconFromSideAndMetadata(block, 2, meta));
	tessellator.setNormal(0.0F, 0.0F, 1.0F);
	renderer.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderer.getBlockIconFromSideAndMetadata(block, 3, meta));
	tessellator.setNormal(-1.0F, 0.0F, 0.0F);
	renderer.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderer.getBlockIconFromSideAndMetadata(block, 4, meta));
	tessellator.setNormal(1.0F, 0.0F, 0.0F);
	renderer.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderer.getBlockIconFromSideAndMetadata(block, 5, meta));
	tessellator.draw();

	OpenGLHelper.translate(0.5F, 0.5F, 0.5F);
	OpenGLHelper.disableBlend();
}
 
Example 16
Source File: ThinLogFenceRenderer.java    From GardenCollection with MIT License 4 votes vote down vote up
private boolean renderWorldBlock (IBlockAccess world, int x, int y, int z, BlockThinLogFence block, int modelId, RenderBlocks renderer) {
    float margin = block.getMargin();

    renderer.setRenderBounds(margin, 0, margin, 1 - margin, 1, 1 - margin);
    renderer.renderStandardBlock(block, x, y, z);

    IIcon sideIcon = block.getSideIcon();

    boolean connectedZNeg = block.canConnectFenceTo(world, x, y, z - 1);
    boolean connectedZPos = block.canConnectFenceTo(world, x, y, z + 1);
    boolean connectedXNeg = block.canConnectFenceTo(world, x - 1, y, z);
    boolean connectedXPos = block.canConnectFenceTo(world, x + 1, y, z);

    if (connectedXNeg || connectedXPos) {
        if (connectedXNeg && connectedXPos)
            renderer.setRenderBounds(0, 0, .5, 1, 1, .5);
        else if (connectedXNeg)
            renderer.setRenderBounds(0, 0, .5, .5, 1, .5);
        else if (connectedXPos)
            renderer.setRenderBounds(.5, 0, .5, 1, 1, .5);

        renderer.flipTexture = true;
        renderer.renderFaceZNeg(block, x, y, z, sideIcon);
        renderer.flipTexture = false;
        renderer.renderFaceZPos(block, x, y, z, sideIcon);
    }

    if (connectedZNeg || connectedZPos) {
        if (connectedZNeg && connectedZPos)
            renderer.setRenderBounds(.5, 0, 0, .5, 1, 1);
        else if (connectedZNeg)
            renderer.setRenderBounds(.5, 0, 0, .5, 1, .5f);
        else if (connectedZPos)
            renderer.setRenderBounds(.5, 0, .5f, .5, 1, 1);

        renderer.flipTexture = true;
        renderer.renderFaceXPos(block, x, y, z, sideIcon);
        renderer.flipTexture = false;
        renderer.renderFaceXNeg(block, x, y, z, sideIcon);

    }

    return true;
}
 
Example 17
Source File: RenderBlockSeat.java    From archimedes-ships with MIT License 4 votes vote down vote up
@Override
public void renderInventoryBlock(Block block, int meta, int modelID, RenderBlocks renderer)
{
	Tessellator tess = Tessellator.instance;
	GL11.glTranslatef(-0.5F, -0.5F, -0.5F);
	tess.startDrawingQuads();
	tess.setNormal(0.0F, -1.0F, 0.0F);
	renderer.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderer.getBlockIconFromSide(block, 0));
	tess.setNormal(0.0F, 1.0F, 0.0F);
	renderer.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderer.getBlockIconFromSide(block, 1));
	tess.setNormal(0.0F, 0.0F, -1.0F);
	renderer.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderer.getBlockIconFromSide(block, 5));
	tess.setNormal(0.0F, 0.0F, 1.0F);
	renderer.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderer.getBlockIconFromSide(block, 2));
	tess.setNormal(-1.0F, 0.0F, 0.0F);
	renderer.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderer.getBlockIconFromSide(block, 3));
	tess.setNormal(1.0F, 0.0F, 0.0F);
	renderer.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderer.getBlockIconFromSide(block, 4));
	tess.draw();
	
	renderer.setRenderBounds(0F, block.getBlockBoundsMaxY(), 0F, 1F, 1F, 0.2F);
	tess.startDrawingQuads();
	tess.setNormal(0.0F, -1.0F, 0.0F);
	renderer.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderer.getBlockIconFromSide(block, 0));
	tess.setNormal(0.0F, 1.0F, 0.0F);
	renderer.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderer.getBlockIconFromSide(block, 1));
	tess.setNormal(0.0F, 0.0F, -1.0F);
	renderer.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderer.getBlockIconFromSide(block, 5));
	tess.setNormal(0.0F, 0.0F, 1.0F);
	renderer.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderer.getBlockIconFromSide(block, 2));
	tess.setNormal(-1.0F, 0.0F, 0.0F);
	renderer.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderer.getBlockIconFromSide(block, 3));
	tess.setNormal(1.0F, 0.0F, 0.0F);
	renderer.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderer.getBlockIconFromSide(block, 4));
	tess.draw();
	GL11.glTranslatef(0.5F, 0.5F, 0.5F);
	
	/*
	renderer.renderAllFaces = true;
	renderer.setRenderBounds(0D, 0D, 0D, 1D, 0.5D, 1D);
	renderer.renderStandardBlock(block, 0, 0, 0);
	if (meta == 0)
	{
		renderer.setRenderBounds(0D, 0D, 0D, 0.2D, 1D, 1D);
	} else if (meta == 1)
	{	
		
	} else if (meta == 2)
	{
		renderer.setRenderBounds(0.8D, 0D, 0D, 1D, 1D, 1D);
	} else if (meta == 3)
	{	
		
	}
	//renderer.renderStandardBlock(block, x, y, z);
	renderer.renderAllFaces = false;
	*/
}
 
Example 18
Source File: RenderHelperTerminalFluid.java    From ExtraCells1 with MIT License 4 votes vote down vote up
public void renderInventoryBlock(Block block, int metadata, int modelID, RenderBlocks renderer)
{
	Tessellator tessellator = Tessellator.instance;
	block.setBlockBoundsForItemRender();
	GL11.glTranslatef(-0.5F, -0.5F, -0.5F);

	tessellator.startDrawingQuads();
	tessellator.setNormal(0.0F, -1.0F, 0.0F);
	renderer.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, block.getIcon(0, metadata));
	tessellator.draw();
	tessellator.startDrawingQuads();
	tessellator.setNormal(0.0F, 1.0F, 0.0F);
	renderer.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, block.getIcon(1, metadata));
	tessellator.draw();
	tessellator.startDrawingQuads();
	tessellator.setNormal(0.0F, 0.0F, -1.0F);
	tessellator.addTranslation(0.0F, 0.0F, 0.0F);
	renderer.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, block.getIcon(2, metadata));
	tessellator.addTranslation(0.0F, 0.0F, 0.0F);
	tessellator.draw();
	tessellator.startDrawingQuads();
	tessellator.setNormal(0.0F, 0.0F, 1.0F);
	tessellator.addTranslation(0.0F, 0.0F, 0.0F);
	renderer.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, block.getIcon(3, metadata));
	tessellator.addTranslation(0.0F, 0.0F, 0.0F);
	tessellator.draw();
	tessellator.startDrawingQuads();
	tessellator.setNormal(-1.0F, 0.0F, 0.0F);
	tessellator.addTranslation(0.0F, 0.0F, 0.0F);

	tessellator.setBrightness(15 << 20 | 15 << 6);
	tessellator.setColorRGBA_I(0xFFFFFF, 0xFF);
	int[] color =
	{ 0x1B2344, 0x895CA8, 0xDABDEF };
	BlockTerminalFluid terminal = (BlockTerminalFluid) block;
	renderer.renderFaceXNeg(block, 0, 0, 0, terminal.baseLayer);
	for (int i = 0; i < 3; i++)
	{
		tessellator.setColorRGBA_I(color[i], 0xFF);
		renderer.renderFaceXNeg(block, 0, 0, 0, terminal.colorLayers[i]);
	}

	tessellator.addTranslation(0.0F, 0.0F, 0.0F);
	tessellator.draw();
	tessellator.startDrawingQuads();
	tessellator.setNormal(1.0F, 0.0F, 0.0F);
	tessellator.addTranslation(0.0F, 0.0F, 0.0F);
	renderer.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, block.getIcon(5, metadata));
	tessellator.addTranslation(0.0F, 0.0F, 0.0F);
	tessellator.draw();

	GL11.glTranslatef(0.5F, 0.5F, 0.5F);
}
 
Example 19
Source File: RotorSimpleRenderer.java    From BigReactors with MIT License 4 votes vote down vote up
public static void renderRotorShaft(Block block, RenderBlocks renderer, int metadata, ForgeDirection majorAxis, boolean[] hasBlades, int x, int y, int z, boolean drawOuterRectangle) {
	double xMin, yMin, zMin;
	double xMax, yMax, zMax;
	xMin = yMin = zMin = 0.5D - rotorSize;
	xMax = yMax = zMax = 0.5D + rotorSize;
	
	if(majorAxis.offsetX != 0) {
		xMax = 1D;
		xMin = 0D;
	}
	if(majorAxis.offsetY != 0) {
		yMax = 1D;
		yMin = 0D;
	}
	if(majorAxis.offsetZ != 0) {
		zMax = 1D;
		zMin = 0D;
	}

       Tessellator.instance.setColorRGBA(255, 255, 255, 255);
       renderer.setRenderBoundsFromBlock(block);
       renderer.setOverrideBlockTexture(null);
	
       renderer.setRenderBounds(xMin, yMin, zMin, xMax, yMax, zMax);
       renderer.renderFaceYNeg(block, x, y, z, renderer.getBlockIconFromSideAndMetadata(block, 0, metadata));
       renderer.setRenderBounds(xMin, yMin, zMin, xMax, yMax, zMax);
       renderer.renderFaceYPos(block, x, y, z, renderer.getBlockIconFromSideAndMetadata(block, 1, metadata));
       renderer.setRenderBounds(xMin, yMin, zMin, xMax, yMax, zMax);
       renderer.renderFaceZNeg(block, x, y, z, renderer.getBlockIconFromSideAndMetadata(block, 2, metadata));
       renderer.setRenderBounds(xMin, yMin, zMin, xMax, yMax, zMax);
       renderer.renderFaceZPos(block, x, y, z, renderer.getBlockIconFromSideAndMetadata(block, 3, metadata));
       renderer.setRenderBounds(xMin, yMin, zMin, xMax, yMax, zMax);
       renderer.renderFaceXNeg(block, x, y, z, renderer.getBlockIconFromSideAndMetadata(block, 4, metadata));
       renderer.setRenderBounds(xMin, yMin, zMin, xMax, yMax, zMax);
       renderer.renderFaceXPos(block, x, y, z, renderer.getBlockIconFromSideAndMetadata(block, 5, metadata));
       renderer.setRenderBounds(0D, 0D, 0D, 1D, 1D, 1D);
       
       // Render blade surfaces, if present
       ForgeDirection[] bladeDirs = StaticUtils.neighborsBySide[majorAxis.ordinal()];
       for(int i = 0; i < bladeDirs.length; i++) {
       	if(hasBlades[i]) {
       		renderRotorBladeConnection(renderer, block, metadata, majorAxis, bladeDirs[i], x, y, z, drawOuterRectangle);
       	}
       }

       renderer.setRenderBounds(0D, 0D, 0D, 1D, 1D, 1D);
}
 
Example 20
Source File: RenderHelperMonitorStorageFluid.java    From ExtraCells1 with MIT License 4 votes vote down vote up
public void renderInventoryBlock(Block block, int metadata, int modelID, RenderBlocks renderer)
{
	Tessellator tessellator = Tessellator.instance;
	block.setBlockBoundsForItemRender();
	GL11.glTranslatef(-0.5F, -0.5F, -0.5F);

	tessellator.startDrawingQuads();
	tessellator.setNormal(0.0F, -1.0F, 0.0F);
	renderer.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, block.getIcon(0, metadata));
	tessellator.draw();
	tessellator.startDrawingQuads();
	tessellator.setNormal(0.0F, 1.0F, 0.0F);
	renderer.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, block.getIcon(1, metadata));
	tessellator.draw();
	tessellator.startDrawingQuads();
	tessellator.setNormal(0.0F, 0.0F, -1.0F);
	tessellator.addTranslation(0.0F, 0.0F, 0.0F);
	renderer.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, block.getIcon(2, metadata));
	tessellator.addTranslation(0.0F, 0.0F, 0.0F);
	tessellator.draw();
	tessellator.startDrawingQuads();
	tessellator.setNormal(0.0F, 0.0F, 1.0F);
	tessellator.addTranslation(0.0F, 0.0F, 0.0F);
	renderer.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, block.getIcon(3, metadata));
	tessellator.addTranslation(0.0F, 0.0F, 0.0F);
	tessellator.draw();
	tessellator.startDrawingQuads();
	tessellator.setNormal(-1.0F, 0.0F, 0.0F);
	tessellator.addTranslation(0.0F, 0.0F, 0.0F);

	tessellator.setBrightness(15 << 20 | 15 << 6);
	tessellator.setColorRGBA_I(0xFFFFFF, 0xFF);
	int[] color =
	{ 0x1B2344, 0x895CA8, 0xDABDEF };
	BlockMonitorStorageFluid terminal = (BlockMonitorStorageFluid) block;
	renderer.renderFaceXNeg(block, 0, 0, 0, terminal.baseLayer);
	for (int i = 0; i < 3; i++)
	{
		tessellator.setColorRGBA_I(color[i], 0xFF);
		renderer.renderFaceXNeg(block, 0, 0, 0, terminal.colorLayers[i]);
	}

	tessellator.addTranslation(0.0F, 0.0F, 0.0F);
	tessellator.draw();
	tessellator.startDrawingQuads();
	tessellator.setNormal(1.0F, 0.0F, 0.0F);
	tessellator.addTranslation(0.0F, 0.0F, 0.0F);
	renderer.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, block.getIcon(5, metadata));
	tessellator.addTranslation(0.0F, 0.0F, 0.0F);
	tessellator.draw();

	GL11.glTranslatef(0.5F, 0.5F, 0.5F);
}