Java Code Examples for net.minecraft.client.renderer.RenderBlocks

The following are top voted examples for showing how to use net.minecraft.client.renderer.RenderBlocks. These examples are extracted from open source projects. You can vote up the examples you like and your votes will be used in our system to generate more good examples.
Example 1
Project: Steam-and-Steel   File: RenderItemBlockGlassTank.java   View source code 6 votes vote down vote up
@Override
public void renderItem(ItemRenderType type, ItemStack item, Object... data) {
	
	RenderBlocks renderblocks = (RenderBlocks) data[0];
	Block block = Block.getBlockFromItem(item.getItem());
	if (item.hasTagCompound()) {
		NBTTagCompound tag = item.stackTagCompound;
		if (tag.hasKey("Fluid")) {
			FluidStack liquid = FluidStack.loadFluidStackFromNBT(item.getTagCompound().getCompoundTag("Fluid"));
			if (liquid != null) {
				GL11.glEnable(GL11.GL_BLEND);
				float height = ((float) liquid.amount / (float) 8000 * (float) 0.99);
				renderblocks.setRenderBounds(0.01, 0.01, 0.01, 0.99, height, 0.99);
				Utils.renderInventoryBlock(renderblocks, GrandFluidTank.renderblocks, liquid.getFluid());
				GL11.glDisable(GL11.GL_BLEND);
			}
		}

		GL11.glEnable(GL11.GL_ALPHA_TEST);
		renderblocks.setRenderBounds(0, 0, 0, 1, 1, 1);
		Utils.renderInventoryBlock(renderblocks, block, GrandFluidTank.glassfluidtank.getIcon(0, 0));
		GL11.glDisable(GL11.GL_ALPHA_TEST);

	}
}
 
Example 2
Project: Steam-and-Steel   File: RenderGlassTank.java   View source code 6 votes vote down vote up
@Override
public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) {
	if (modelId == renderID) {
		TileGlassFluidTank tank = (TileGlassFluidTank) world.getTileEntity(x, y, z);
		if (renderPass == 0) {
			if (tank.tank.getFluid() != null) {
				Fluid fluid = tank.tank.getFluid().getFluid();
				Utils.renderBlockByCompleteness(GrandFluidTank.renderblocks,fluid, world.getBlockMetadata(x, y, z), renderer, (double) tank.tank.getFluidAmount() / (double) tank.tank.getCapacity(), x, y, z);
			}
		}
		else if (renderPass == 1) {
			renderer.setRenderBounds(0, 0, 0, 1, 1, 1);
			renderer.renderStandardBlock(block, x, y, z);
			renderer.setRenderFromInside(true);
			renderer.setRenderBounds(0, 0, 0, 1, 1, 1);
			renderer.renderStandardBlock(block, x, y, z);
			renderer.setRenderFromInside(false);
		}
	}
	return true;
}
 
Example 3
Project: connor41-etfuturum2   File: BlockChorusFlowerRender.java   View source code 6 votes vote down vote up
@Override
public void renderInventoryBlock(Block block, int meta, int modelID, RenderBlocks renderer) {
	OpenGLHelper.translate(-0.5F, -0.5F, -0.5F);

	renderer.setRenderBounds(2 / 16F, 14 / 16F, 2 / 16F, 14 / 16F, 1, 14 / 16F);
	renderCube(renderer, block, meta);
	renderer.setRenderBounds(0, 2 / 16F, 2 / 16F, 2 / 16F, 14 / 16F, 14 / 16F);
	renderCube(renderer, block, meta);
	renderer.setRenderBounds(2 / 16F, 2 / 16F, 0, 14 / 16F, 14 / 16F, 2 / 16F);
	renderCube(renderer, block, meta);
	renderer.setRenderBounds(2 / 16F, 2 / 16F, 14 / 16F, 14 / 16F, 14 / 16F, 1);
	renderCube(renderer, block, meta);
	renderer.setRenderBounds(14 / 16F, 2 / 16F, 2 / 16F, 1, 14 / 16F, 14 / 16F);
	renderCube(renderer, block, meta);
	renderer.setRenderBounds(2 / 16F, 0, 2 / 16F, 14 / 16F, 14 / 16F, 14 / 16F);
	renderCube(renderer, block, meta);
}
 
Example 4
Project: connor41-etfuturum2   File: BlockChorusFlowerRender.java   View source code 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 5
Project: connor41-etfuturum2   File: BlockChorusFlowerRender.java   View source code 6 votes vote down vote up
@Override
public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) {
	renderer.renderAllFaces = true;

	renderer.setRenderBounds(2 / 16F, 14 / 16F, 2 / 16F, 14 / 16F, 1, 14 / 16F);
	renderer.renderStandardBlock(block, x, y, z);

	renderer.setRenderBounds(0, 2 / 16F, 2 / 16F, 2 / 16F, 14 / 16F, 14 / 16F);
	renderer.renderStandardBlock(block, x, y, z);

	renderer.setRenderBounds(2 / 16F, 2 / 16F, 0, 14 / 16F, 14 / 16F, 2 / 16F);
	renderer.renderStandardBlock(block, x, y, z);

	renderer.setRenderBounds(2 / 16F, 2 / 16F, 14 / 16F, 14 / 16F, 14 / 16F, 1);
	renderer.renderStandardBlock(block, x, y, z);

	renderer.setRenderBounds(14 / 16F, 2 / 16F, 2 / 16F, 1, 14 / 16F, 14 / 16F);
	renderer.renderStandardBlock(block, x, y, z);

	renderer.setRenderBounds(2 / 16F, 0, 2 / 16F, 14 / 16F, 14 / 16F, 14 / 16F);
	renderer.renderStandardBlock(block, x, y, z);

	renderer.renderAllFaces = false;
	return true;
}
 
Example 6
Project: ThaumOres   File: BlockInfusedBlockOreRenderer.java   View source code 6 votes vote down vote up
@Override
public void renderInventoryBlock(Block block, int metadata, int modelID, RenderBlocks renderer) {
	block.setBlockBounds(0.005F, 0.005F, 0.005F, 0.995F, 0.995F, 0.995F);
	renderer.setRenderBoundsFromBlock(block);

	if (metadata < 6) {
		drawFaces(renderer, block, ((BlockInfusedBlockOre) block).icon[0], ((BlockInfusedBlockOre) block).icon[1],
				((BlockInfusedBlockOre) block).icon[2], ((BlockInfusedBlockOre) block).icon[3],
				((BlockInfusedBlockOre) block).icon[4], ((BlockInfusedBlockOre) block).icon[5], false);
		Color c = new Color(BlockCustomOreItem.colors[metadata + 1]);
		float r = c.getRed() / 255.0F;
		float g = c.getGreen() / 255.0F;
		float b = c.getBlue() / 255.0F;
		GL11.glColor3f(r, g, b);
		block.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
		renderer.setRenderBoundsFromBlock(block);
		drawFaces(renderer, block, ((BlockInfusedBlockOre) block).icon[6], false);
		GL11.glColor3f(1.0F, 1.0F, 1.0F);
	}
}
 
Example 7
Project: ExtraUtilities   File: RenderBlockFullBright.java   View source code 6 votes vote down vote up
public void renderInventoryBlock(final Block block, final int metadata, final int modelID, final RenderBlocks renderer) {
    final Tessellator var4 = Tessellator.instance;
    block.setBlockBoundsForItemRender();
    renderer.setRenderBoundsFromBlock(block);
    GL11.glRotatef(90.0f, 0.0f, 1.0f, 0.0f);
    GL11.glTranslatef(-0.5f, -0.0f, -0.5f);
    final int l = block.getRenderColor(metadata);
    final float r = (l >> 16 & 0xFF) / 255.0f;
    final float g = (l >> 8 & 0xFF) / 255.0f;
    final float b = (l & 0xFF) / 255.0f;
    GL11.glColor4f(r, g, b, 1.0f);
    GL11.glDisable(2896);
    renderer.enableAO = false;
    var4.startDrawingQuads();
    var4.setNormal(0.0f, 1.0f, 0.0f);
    renderer.renderFaceYNeg(block, 0.0, -0.5, 0.0, block.getIcon(0, metadata));
    renderer.renderFaceYPos(block, 0.0, -0.5, 0.0, block.getIcon(1, metadata));
    renderer.renderFaceZNeg(block, 0.0, -0.5, 0.0, block.getIcon(2, metadata));
    renderer.renderFaceZPos(block, 0.0, -0.5, 0.0, block.getIcon(3, metadata));
    renderer.renderFaceXNeg(block, 0.0, -0.5, 0.0, block.getIcon(4, metadata));
    renderer.renderFaceXPos(block, 0.0, -0.5, 0.0, block.getIcon(5, metadata));
    var4.draw();
    GL11.glTranslatef(0.5f, 0.0f, 0.5f);
    GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f);
    GL11.glEnable(2896);
}
 
Example 8
Project: ExtraUtilities   File: RenderBlockColor.java   View source code 6 votes vote down vote up
public boolean renderWorldBlock(final IBlockAccess world, final int par2, final int par3, final int par4, final Block par1Block, final int modelId, final RenderBlocks renderer) {
    final Tessellator var8 = Tessellator.instance;
    final int i = world.getBlockMetadata(par2, par3, par4);
    float f = BlockColor.initColor[i][0];
    float f2 = BlockColor.initColor[i][1];
    float f3 = BlockColor.initColor[i][2];
    final TileEntity data = world.getTileEntity(BlockColorData.dataBlockX(par2), BlockColorData.dataBlockY(par3), BlockColorData.dataBlockZ(par4));
    if (data instanceof TileEntityBlockColorData) {
        f = ((TileEntityBlockColorData)data).palette[i][0];
        f2 = ((TileEntityBlockColorData)data).palette[i][1];
        f3 = ((TileEntityBlockColorData)data).palette[i][2];
    }
    if (EntityRenderer.anaglyphEnable) {
        final float f4 = (f * 30.0f + f2 * 59.0f + f3 * 11.0f) / 100.0f;
        final float f5 = (f * 30.0f + f2 * 70.0f) / 100.0f;
        final float f6 = (f * 30.0f + f3 * 70.0f) / 100.0f;
        f = f4;
        f2 = f5;
        f3 = f6;
    }
    return (Minecraft.isAmbientOcclusionEnabled() && par1Block.getLightValue() == 0) ? renderer.renderStandardBlockWithAmbientOcclusion(par1Block, par2, par3, par4, f, f2, f3) : renderer.renderStandardBlockWithColorMultiplier(par1Block, par2, par3, par4, f, f2, f3);
}
 
Example 9
Project: 4Space-5   File: ItemRendererMachine.java   View source code 6 votes vote down vote up
private void renderCryogenicChamber(ItemRenderType type, RenderBlocks render, ItemStack item, float translateX, float translateY, float translateZ)
{
    GL11.glPushMatrix();

    this.transform(type);

    FMLClientHandler.instance().getClient().renderEngine.bindTexture(ItemRendererMachine.chamberTexture0);
    this.model.renderPart("Main_Cylinder");

    GL11.glDisable(GL11.GL_TEXTURE_2D);
    GL11.glEnable(GL11.GL_BLEND);
    GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
    GL11.glColor4f(0.1F, 0.6F, 0.5F, 0.4F);

    this.model.renderPart("Shield_Torus");

    GL11.glEnable(GL11.GL_TEXTURE_2D);
    GL11.glPopMatrix();
}
 
Example 10
Project: PrimitiveCraft   File: ModelCampfire.java   View source code 6 votes vote down vote up
public void renderFluid(float f5)
 {
 	if(hasFluid && hasJug)
 	{
 		GL11.glPushMatrix();
 		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);
 		float scale = 0.5F;
 		GL11.glScalef(scale, scale, scale);
 		GL11.glTranslatef(0f, 2.0F, 0f);

 		Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.locationBlocksTexture);
      
  	RenderBlocks renderBlocks = RenderBlocks.getInstance();
      renderBlocks.setOverrideBlockTexture(fluidstack.getFluid().getStillIcon());
      renderBlocks.renderBlockAsItem(Blocks.stone, 0, 1.0f);

      renderBlocks.clearOverrideBlockTexture();

GL11.glPopAttrib();
GL11.glPopMatrix();
 	}
 }
 
Example 11
Project: 4Space-5   File: BlockRendererCavernousVines.java   View source code 6 votes vote down vote up
public void renderBlockMeteor(RenderBlocks renderBlocks, Block par1Block, IBlockAccess var1, int par2, int par3, int par4)
{
    Tessellator tessellator = Tessellator.instance;
    tessellator.setBrightness(par1Block.getMixedBrightnessForBlock(var1, par2, par3, par4));
    float f = 1.0F;
    int l = par1Block.colorMultiplier(var1, par2, par3, par4);
    float f1 = (l >> 16 & 255) / 255.0F;
    float f2 = (l >> 8 & 255) / 255.0F;
    float f3 = (l & 255) / 255.0F;

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

    tessellator.setColorOpaque_F(f * f1, f * f2, f * f3);

    renderBlocks.drawCrossedSquares(par1Block.getIcon(0, var1.getBlockMetadata(par2, par3, par4)), par2, par3, par4, 1.0F);
}
 
Example 12
Project: 4Space-5   File: BlockRendererEgg.java   View source code 6 votes vote down vote up
public static void renderInvNormalBlock(RenderBlocks renderBlocks, Block par1Block, int var2)
{
    renderBlocks.setRenderBounds(0.2F, 0.0F, 0.2F, 0.8F, 0.5F, 0.8F);
    BlockRendererEgg.renderStandardBlock(renderBlocks, par1Block, var2);

    renderBlocks.setRenderBounds(0.52F, 0.0F, 0.4F, 0.68F, 0.68F, 0.6F);
    BlockRendererEgg.renderStandardBlock(renderBlocks, par1Block, var2);

    renderBlocks.setRenderBounds(0.25F, 0.0F, 0.25F, 0.75F, 0.65F, 0.75F);
    BlockRendererEgg.renderStandardBlock(renderBlocks, par1Block, var2);

    renderBlocks.setRenderBounds(0.15F, 0.0F, 0.25F, 0.2F, 0.4F, 0.75F);
    BlockRendererEgg.renderStandardBlock(renderBlocks, par1Block, var2);

    renderBlocks.setRenderBounds(0.8F, 0.0F, 0.25F, 0.85F, 0.4F, 0.75F);
    BlockRendererEgg.renderStandardBlock(renderBlocks, par1Block, var2);

    renderBlocks.setRenderBounds(0.25F, 0.0F, 0.1F, 0.75F, 0.4F, 0.2F);
    BlockRendererEgg.renderStandardBlock(renderBlocks, par1Block, var2);

    renderBlocks.setRenderBounds(0.25F, 0.0F, 0.8F, 0.75F, 0.4F, 0.9F);
    BlockRendererEgg.renderStandardBlock(renderBlocks, par1Block, var2);

    renderBlocks.clearOverrideBlockTexture();
}
 
Example 13
Project: 4Space-5   File: BlockRendererMachine.java   View source code 6 votes vote down vote up
public void renderMachineInWorld(RenderBlocks renderBlocks, IBlockAccess iblockaccess, Block par1Block, int x, int y, int z)
{
    par1Block.setBlockBoundsBasedOnState(iblockaccess, x, y, z);
    renderBlocks.setRenderBoundsFromBlock(par1Block);

    int metadata = iblockaccess.getBlockMetadata(x, y, z) & 12;

    if (metadata == BlockMachineMars.CRYOGENIC_CHAMBER_METADATA && par1Block == MarsBlocks.machine)
    {

    }
    else
    {
        renderBlocks.renderStandardBlock(par1Block, x, y, z);
    }

    renderBlocks.clearOverrideBlockTexture();
}
 
Example 14
Project: 4Space-5   File: ItemRendererTier3Rocket.java   View source code 6 votes vote down vote up
@Override
public void renderItem(ItemRenderType type, ItemStack item, Object... data)
{
    switch (type)
    {
    case EQUIPPED:
        this.renderSpaceship(type, (RenderBlocks) data[0], item, -0.5f, -0.5f, -0.5f);
        break;
    case EQUIPPED_FIRST_PERSON:
        this.renderSpaceship(type, (RenderBlocks) data[0], item, -0.5f, -0.5f, -0.5f);
        break;
    case INVENTORY:
        this.renderSpaceship(type, (RenderBlocks) data[0], item, -0.5f, -0.5f, -0.5f);
        break;
    case ENTITY:
        this.renderSpaceship(type, (RenderBlocks) data[0], item, -0.5f, -0.5f, -0.5f);
        break;
    default:
    }
}
 
Example 15
Project: 4Space-5   File: ItemRendererShortRangeTelepad.java   View source code 6 votes vote down vote up
@Override
public void renderItem(ItemRenderType type, ItemStack item, Object... data)
{
    switch (type)
    {
    case EQUIPPED:
        this.renderBeamReceiver(type, (RenderBlocks) data[0], item, -0.5f, -0.5f, -0.5f);
        break;
    case EQUIPPED_FIRST_PERSON:
        this.renderBeamReceiver(type, (RenderBlocks) data[0], item, -0.5f, -0.5f, -0.5f);
        break;
    case INVENTORY:
        this.renderBeamReceiver(type, (RenderBlocks) data[0], item, -0.5f, -0.5f, -0.5f);
        break;
    case ENTITY:
        this.renderBeamReceiver(type, (RenderBlocks) data[0], item, -0.5f, -0.5f, -0.5f);
        break;
    default:
        break;
    }
}
 
Example 16
Project: 4Space-5   File: ItemRendererWalkway.java   View source code 6 votes vote down vote up
@Override
public void renderItem(ItemRenderType type, ItemStack item, Object... data)
{
    switch (type)
    {
    case EQUIPPED:
        this.renderWalkway(type, (RenderBlocks) data[0], item, -0.5f, -0.5f, -0.5f);
        break;
    case EQUIPPED_FIRST_PERSON:
        this.renderWalkway(type, (RenderBlocks) data[0], item, -0.5f, -0.5f, -0.5f);
        break;
    case INVENTORY:
        this.renderWalkway(type, (RenderBlocks) data[0], item, -0.5f, -0.5f, -0.5f);
        break;
    case ENTITY:
        this.renderWalkway(type, (RenderBlocks) data[0], item, -0.5f, -0.5f, -0.5f);
        break;
    default:
        break;
    }
}
 
Example 17
Project: 4Space-5   File: ItemRendererAstroMiner.java   View source code 6 votes vote down vote up
protected void renderMiner(ItemRenderType type, RenderBlocks render, ItemStack item, float translateX, float translateY, float translateZ)
{
	boolean saveCullState = GL11.glIsEnabled(GL11.GL_CULL_FACE);
	GL11.glEnable(GL11.GL_CULL_FACE);
	GL11.glPushMatrix();

    this.transform(item, type);
    GL11.glScalef(0.06F, 0.06F, 0.06F);

    FMLClientHandler.instance().getClient().renderEngine.bindTexture(this.texture);
    this.modelMiner.renderAll();
    GL11.glTranslatef(1.875F, 0F, 0F);
 this.modellasergl.renderAll();
    GL11.glTranslatef(-3.75F, 0F, 0F);
 this.modellasergr.renderAll();
    GL11.glPopMatrix();
	if (!saveCullState) GL11.glDisable(GL11.GL_CULL_FACE);
}
 
Example 18
Project: 4Space-5   File: ItemRendererAstroMiner.java   View source code 6 votes vote down vote up
@Override
public void renderItem(ItemRenderType type, ItemStack item, Object... data)
{
    switch (type)
    {
    case EQUIPPED:
        this.renderMiner(type, (RenderBlocks) data[0], item, -0.5f, -0.5f, -0.5f);
        break;
    case EQUIPPED_FIRST_PERSON:
        this.renderMiner(type, (RenderBlocks) data[0], item, -0.5f, -0.5f, -0.5f);
        break;
    case INVENTORY:
        this.renderMiner(type, (RenderBlocks) data[0], item, -0.5f, -0.5f, -0.5f);
        break;
    case ENTITY:
        this.renderMiner(type, (RenderBlocks) data[0], item, -0.5f, -0.5f, -0.5f);
        break;
    default:
    }
}
 
Example 19
Project: 4Space-5   File: ItemRendererBeamReflector.java   View source code 6 votes vote down vote up
@Override
public void renderItem(ItemRenderType type, ItemStack item, Object... data)
{
    switch (type)
    {
    case EQUIPPED:
        this.renderBeamReflector(type, (RenderBlocks) data[0], item, -0.5f, -0.5f, -0.5f);
        break;
    case EQUIPPED_FIRST_PERSON:
        this.renderBeamReflector(type, (RenderBlocks) data[0], item, -0.5f, -0.5f, -0.5f);
        break;
    case INVENTORY:
        this.renderBeamReflector(type, (RenderBlocks) data[0], item, -0.5f, -0.5f, -0.5f);
        break;
    case ENTITY:
        this.renderBeamReflector(type, (RenderBlocks) data[0], item, -0.5f, -0.5f, -0.5f);
        break;
    default:
        break;
    }
}
 
Example 20
Project: 4Space-5   File: ItemRendererBeamReceiver.java   View source code 6 votes vote down vote up
private void renderBeamReceiver(ItemRenderType type, RenderBlocks render, ItemStack item, float translateX, float translateY, float translateZ)
{
    GL11.glPushMatrix();
    this.transform(type);

    GL11.glColor3f(1.0F, 1.0F, 1.0F);

    FMLClientHandler.instance().getClient().renderEngine.bindTexture(TileEntityBeamReceiverRenderer.receiverTexture);
    TileEntityBeamReceiverRenderer.receiverModel.renderPart("Main");
    TileEntityBeamReceiverRenderer.receiverModel.renderPart("Ring");

    GL11.glColor3f(0.6F, 0.3F, 0.0F);

    GL11.glDisable(GL11.GL_TEXTURE_2D);
    GL11.glDisable(GL11.GL_CULL_FACE);
    TileEntityBeamReceiverRenderer.receiverModel.renderPart("Receiver");
    GL11.glEnable(GL11.GL_TEXTURE_2D);
    GL11.glEnable(GL11.GL_CULL_FACE);

    GL11.glPopMatrix();
}
 
Example 21
Project: 4Space-5   File: ItemRendererBuggy.java   View source code 6 votes vote down vote up
@Override
public void renderItem(ItemRenderType type, ItemStack item, Object... data)
{
    switch (type)
    {
    case EQUIPPED:
        this.renderPipeItem(type, (RenderBlocks) data[0], item, -0.5f, -0.5f, -0.5f);
        break;
    case EQUIPPED_FIRST_PERSON:
        this.renderPipeItem(type, (RenderBlocks) data[0], item, -0.5f, -0.5f, -0.5f);
        break;
    case INVENTORY:
        this.renderPipeItem(type, (RenderBlocks) data[0], item, -0.5f, -0.5f, -0.5f);
        break;
    case ENTITY:
        this.renderPipeItem(type, (RenderBlocks) data[0], item, -0.5f, -0.5f, -0.5f);
        break;
    default:
    }
}
 
Example 22
Project: 4Space-5   File: ItemRendererThruster.java   View source code 6 votes vote down vote up
@Override
public void renderItem(ItemRenderType type, ItemStack item, Object... data)
{
    switch (type)
    {
    case EQUIPPED:
        this.renderThruster(type, (RenderBlocks) data[0], item, -0.5f, -0.5f, -0.5f);
        break;
    case EQUIPPED_FIRST_PERSON:
        this.renderThruster(type, (RenderBlocks) data[0], item, -0.5f, -0.5f, -0.5f);
        break;
    case INVENTORY:
        this.renderThruster(type, (RenderBlocks) data[0], item, -0.5f, -0.5f, -0.5f);
        break;
    case ENTITY:
        this.renderThruster(type, (RenderBlocks) data[0], item, -0.5f, -0.5f, -0.5f);
        break;
    default:
    }
}
 
Example 23
Project: 4Space-5   File: ItemRendererTier1Rocket.java   View source code 6 votes vote down vote up
@Override
public void renderItem(ItemRenderType type, ItemStack item, Object... data)
{
    switch (type)
    {
    case EQUIPPED:
        this.renderSpaceship(type, (RenderBlocks) data[0], item, -0.5f, -0.5f, -0.5f);
        break;
    case EQUIPPED_FIRST_PERSON:
        this.renderSpaceship(type, (RenderBlocks) data[0], item, -0.5f, -0.5f, -0.5f);
        break;
    case INVENTORY:
        this.renderSpaceship(type, (RenderBlocks) data[0], item, -0.5f, -0.5f, -0.5f);
        break;
    case ENTITY:
        this.renderSpaceship(type, (RenderBlocks) data[0], item, -0.5f, -0.5f, -0.5f);
        break;
    default:
    }
}
 
Example 24
Project: 4Space-5   File: ItemRendererKey.java   View source code 6 votes vote down vote up
@Override
public void renderItem(ItemRenderType type, ItemStack item, Object... data)
{
    switch (type)
    {
    case EQUIPPED:
        this.renderKey(type, (RenderBlocks) data[0], item, -0.5f, -0.5f, -0.5f, data);
        break;
    case EQUIPPED_FIRST_PERSON:
        this.renderKey(type, (RenderBlocks) data[0], item, -0.5f, -0.5f, -0.5f, data);
        break;
    case INVENTORY:
        this.renderKey(type, (RenderBlocks) data[0], item, -0.5f, -0.5f, -0.5f, data);
        break;
    case ENTITY:
        this.renderKey(type, (RenderBlocks) data[0], item, -0.5f, -0.5f, -0.5f, data);
        break;
    default:
    }
}
 
Example 25
Project: 4Space-5   File: ItemRendererMeteorChunk.java   View source code 6 votes vote down vote up
@Override
public void renderItem(ItemRenderType type, ItemStack item, Object... data)
{
    switch (type)
    {
    case EQUIPPED:
        this.renderMeteorChunk(type, (RenderBlocks) data[0], item, -0.5f, -0.5f, -0.5f);
        break;
    case EQUIPPED_FIRST_PERSON:
        this.renderMeteorChunk(type, (RenderBlocks) data[0], item, -0.5f, -0.5f, -0.5f);
        break;
    case INVENTORY:
        this.renderMeteorChunk(type, (RenderBlocks) data[0], item, -0.5f, -0.5f, -0.5f);
        break;
    case ENTITY:
        this.renderMeteorChunk(type, (RenderBlocks) data[0], item, -0.5f, -0.5f, -0.5f);
        break;
    default:
    }
}
 
Example 26
Project: 4Space-5   File: ItemRendererFlag.java   View source code 6 votes vote down vote up
@Override
public void renderItem(ItemRenderType type, ItemStack item, Object... data)
{
    switch (type)
    {
    case EQUIPPED:
        this.renderFlag(type, (RenderBlocks) data[0], item, -0.5f, -0.5f, -0.5f, data);
        break;
    case EQUIPPED_FIRST_PERSON:
        this.renderFlag(type, (RenderBlocks) data[0], item, -0.5f, -0.5f, -0.5f, data);
        break;
    case INVENTORY:
        this.renderFlag(type, (RenderBlocks) data[0], item, -0.5f, -0.5f, -0.5f, data);
        break;
    case ENTITY:
        this.renderFlag(type, (RenderBlocks) data[0], item, -0.5f, -0.5f, -0.5f, data);
        break;
    default:
    }
}
 
Example 27
Project: 4Space-5   File: ItemRendererScreen.java   View source code 6 votes vote down vote up
@Override
public void renderItem(ItemRenderType type, ItemStack item, Object... data)
{
    switch (type)
    {
    case EQUIPPED:
        this.renderScreen(type, (RenderBlocks) data[0], item, -0.5f, -0.5f, -0.5f);
        break;
    case EQUIPPED_FIRST_PERSON:
        this.renderScreen(type, (RenderBlocks) data[0], item, -0.5f, -0.5f, -0.5f);
        break;
    case INVENTORY:
        this.renderScreen(type, (RenderBlocks) data[0], item, -0.5f, -0.5f, -0.5f);
        break;
    case ENTITY:
        this.renderScreen(type, (RenderBlocks) data[0], item, -0.5f, -0.5f, -0.5f);
        break;
    default:
    }
}
 
Example 28
Project: TRHS_Club_Mod_2016   File: ForgeHooksClient.java   View source code 6 votes vote down vote up
public static void renderEquippedItem(ItemRenderType type, IItemRenderer customRenderer, RenderBlocks renderBlocks, EntityLivingBase entity, ItemStack item)
{
    if (customRenderer.shouldUseRenderHelper(type, item, EQUIPPED_BLOCK))
    {
        GL11.glPushMatrix();
        GL11.glTranslatef(-0.5F, -0.5F, -0.5F);
        customRenderer.renderItem(type, item, renderBlocks, entity);
        GL11.glPopMatrix();
    }
    else
    {
        GL11.glPushMatrix();
        GL11.glEnable(GL12.GL_RESCALE_NORMAL);
        GL11.glTranslatef(0.0F, -0.3F, 0.0F);
        GL11.glScalef(1.5F, 1.5F, 1.5F);
        GL11.glRotatef(50.0F, 0.0F, 1.0F, 0.0F);
        GL11.glRotatef(335.0F, 0.0F, 0.0F, 1.0F);
        GL11.glTranslatef(-0.9375F, -0.0625F, 0.0F);
        customRenderer.renderItem(type, item, renderBlocks, entity);
        GL11.glDisable(GL12.GL_RESCALE_NORMAL);
        GL11.glPopMatrix();
    }
}
 
Example 29
Project: PrimitiveCraft   File: ModelJug.java   View source code 6 votes vote down vote up
public void renderFluid(float f5)
 {
 	if(hasFluid)
 	{
 		GL11.glPushMatrix();
 		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);
 		float scale = 0.5F;
 		GL11.glScalef(scale, scale, scale);
 		GL11.glTranslatef(0f, 2.0F, 0f);

 		Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.locationBlocksTexture);
      
  	RenderBlocks renderBlocks = RenderBlocks.getInstance();
      renderBlocks.setOverrideBlockTexture(fluidstack.getFluid().getStillIcon());
      renderBlocks.renderBlockAsItem(Blocks.stone, 0, 1.0f);

      renderBlocks.clearOverrideBlockTexture();

GL11.glPopAttrib();
GL11.glPopMatrix();
 	}
 }
 
Example 30
Project: TFCTech   File: RenderWireDrawBench.java   View source code 6 votes vote down vote up
private void setRotatedRenderBounds(RenderBlocks renderer, byte rotation, float minX, float minY, float minZ, float maxX, float maxY, float maxZ) {
	switch (rotation) {
	case 0:
		renderer.setRenderBounds(minX, minY, minZ, maxX, maxY, maxZ);
		break;
	case 1:
		renderer.setRenderBounds(MAX_Z - maxZ - 1F + P, minY, minX, MAX_Z - minZ - 1F + P, maxY, maxX);
		break;
	case 2:
		renderer.setRenderBounds(1F - maxX, minY, MAX_Z - maxZ - 1F + P, 1F - minX, maxY, MAX_Z - minZ - 1F + P);
		break;
	case 3:
		renderer.setRenderBounds(minZ, minY, 1F - maxX, maxZ, maxY, 1F - minX);
		break;
	default:
		break;
	}
}
 
Example 31
Project: TFCTech   File: RenderLatexExtractor.java   View source code 6 votes vote down vote up
private void setRotatedRenderBounds(RenderBlocks renderer, byte rotation, float minX, float minY, float minZ, float maxX, float maxY, float maxZ) {
	switch (rotation) {
	case 0:
		renderer.setRenderBounds(minX, minY, minZ, maxX, maxY, maxZ);
		break;
	case 1:
		renderer.setRenderBounds(MAX_Z - maxZ, minY, minX, MAX_Z - minZ, maxY, maxX);
		break;
	case 2:
		renderer.setRenderBounds(minX, minY, MAX_Z - maxZ, maxX, maxY, MAX_Z - minZ);
		break;
	case 3:
		renderer.setRenderBounds(minZ, minY, minX, maxZ, maxY, maxX);
		break;
	default:
		break;
	}
}
 
Example 32
Project: Steam-and-Steel   File: Utils.java   View source code 5 votes vote down vote up
public static void renderBlockByCompleteness(Block block, Fluid fluid, int meta, RenderBlocks renderer, double complete, int x, int y, int z) {

		renderer.setRenderBounds(0.01, 0.01, 0.01, 0.99, complete * 0.99, 0.99);
		renderer.setOverrideBlockTexture(fluid.getIcon());
		renderer.renderStandardBlock(block, x, y, z);
		renderer.clearOverrideBlockTexture();
	}
 
Example 33
Project: Steam-and-Steel   File: Utils.java   View source code 5 votes vote down vote up
public static void renderInventoryBlock(RenderBlocks renderblocks, Block block, IIcon icon) {
	
	Tessellator tessellator = Tessellator.instance;
	GL11.glTranslatef(-0.5F, -0.5F, -0.5F);
	tessellator.startDrawingQuads();
	tessellator.setNormal(0.0F, -1F, 0.0F);
	renderblocks.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, getValidIIcon(icon));
	tessellator.draw();
	tessellator.startDrawingQuads();
	tessellator.setNormal(0.0F, 1.0F, 0.0F);
	renderblocks.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, getValidIIcon(icon));
	tessellator.draw();
	tessellator.startDrawingQuads();
	tessellator.setNormal(0.0F, 0.0F, -1F);
	renderblocks.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, getValidIIcon(icon));
	tessellator.draw();
	tessellator.startDrawingQuads();
	tessellator.setNormal(0.0F, 0.0F, 1.0F);
	renderblocks.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, getValidIIcon(icon));
	tessellator.draw();
	tessellator.startDrawingQuads();
	tessellator.setNormal(-1F, 0.0F, 0.0F);
	renderblocks.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, getValidIIcon(icon));
	tessellator.draw();
	tessellator.startDrawingQuads();
	tessellator.setNormal(1.0F, 0.0F, 0.0F);
	renderblocks.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, getValidIIcon(icon));
	tessellator.draw();
	GL11.glTranslatef(0.5F, 0.5F, 0.5F);
	
}
 
Example 34
Project: Steam-and-Steel   File: Utils.java   View source code 5 votes vote down vote up
public static void renderInventoryBlock(RenderBlocks renderblocks, Block block, Fluid fluid) {
	
	Tessellator tessellator = Tessellator.instance;
	GL11.glTranslatef(-0.5F, -0.5F, -0.5F);
	tessellator.startDrawingQuads();
	tessellator.setNormal(0.0F, -1F, 0.0F);
	renderblocks.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, getValidIIcon(fluid.getIcon()));
	tessellator.draw();
	tessellator.startDrawingQuads();
	tessellator.setNormal(0.0F, 1.0F, 0.0F);
	renderblocks.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, getValidIIcon(fluid.getIcon()));
	tessellator.draw();
	tessellator.startDrawingQuads();
	tessellator.setNormal(0.0F, 0.0F, -1F);
	renderblocks.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, getValidIIcon(fluid.getIcon()));
	tessellator.draw();
	tessellator.startDrawingQuads();
	tessellator.setNormal(0.0F, 0.0F, 1.0F);
	renderblocks.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, getValidIIcon(fluid.getIcon()));
	tessellator.draw();
	tessellator.startDrawingQuads();
	tessellator.setNormal(-1F, 0.0F, 0.0F);
	renderblocks.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, getValidIIcon(fluid.getIcon()));
	tessellator.draw();
	tessellator.startDrawingQuads();
	tessellator.setNormal(1.0F, 0.0F, 0.0F);
	renderblocks.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, getValidIIcon(fluid.getIcon()));
	tessellator.draw();
	GL11.glTranslatef(0.5F, 0.5F, 0.5F);
}
 
Example 35
Project: connor41-etfuturum2   File: BlockSlimeBlockRender.java   View source code 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.renderStandardBlock(ModBlocks.slime, x, y, z);
	float f = 0.0625F;
	renderer.setRenderBounds(f * 3, f * 3, f * 3, f * 13, f * 13, f * 13);
	renderer.renderAllFaces = true;
	boolean flag = renderer.renderStandardBlock(ModBlocks.slime, x, y, z);
	renderer.renderAllFaces = false;
	return flag;
}
 
Example 36
Project: TFCPrimitiveTech   File: RenderWoodenPress.java   View source code 5 votes vote down vote up
@Override
public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer)
{
    setBound(_bound, renderer);
    renderer.renderStandardBlock(block, x, y, z);

    return true;
}
 
Example 37
Project: TFCPrimitiveTech   File: RenderWoodenPress.java   View source code 5 votes vote down vote up
private static void renderInvBlock(Block block, RenderBlocks renderer)
{
    Tessellator var14 = Tessellator.instance;
    
    GL11.glTranslatef(-0.5F, -0.5F, -0.5F);
    var14.startDrawingQuads();
    var14.setNormal(0.0F, -1.0F, 0.0F);
    renderer.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, block.getIcon(0, 0));
    var14.draw();
    var14.startDrawingQuads();
    var14.setNormal(0.0F, 1.0F, 0.0F);
    renderer.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, block.getIcon(1, 0));
    var14.draw();
    var14.startDrawingQuads();
    var14.setNormal(-1.0F, 0.0F, 0.0F);
    renderer.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, block.getIcon(2, 0));
    var14.draw();
    var14.startDrawingQuads();
    var14.setNormal(0.0F, 0.0F, -1.0F);
    renderer.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, block.getIcon(3, 0));
    var14.draw();
    var14.startDrawingQuads();
    var14.setNormal(-1.0F, 0.0F, 0.0F);
    renderer.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, block.getIcon(4, 0));
    var14.draw();
    var14.startDrawingQuads();
    var14.setNormal(0.0F, 0.0F, 1.0F);
    renderer.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, block.getIcon(5, 0));
    var14.draw();
    GL11.glTranslatef(0.5F, 0.5F, 0.5F);
}
 
Example 38
Project: ThaumOres   File: BlockInfusedBlockOreRenderer.java   View source code 5 votes vote down vote up
@Override
public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId,
		RenderBlocks renderer) {
	if (world != null && block instanceof BlockInfusedBlockOre)
		return renderWorldBlock(world, x, y, z, (BlockInfusedBlockOre) block, modelId, renderer);
	return false;
}
 
Example 39
Project: ThaumOres   File: BlockInfusedBlockOreRenderer.java   View source code 5 votes vote down vote up
private boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, BlockInfusedBlockOre block, int modelId,
		RenderBlocks renderer) {
	renderer.setRenderBoundsFromBlock(block);
	renderer.renderStandardBlock(block.getBaseBlock(), x, y, z);
	renderer.clearOverrideBlockTexture();
	return true;
}
 
Example 40
Project: ExtraUtilities   File: RenderItemBlockDrum.java   View source code 5 votes vote down vote up
public void renderItem(final IItemRenderer.ItemRenderType type, final ItemStack item, final Object... data) {
    if (!(item.getItem() instanceof ItemBlock)) {
        return;
    }
    final Block block = ((ItemBlock)item.getItem()).field_150939_a;
    if (block == null) {
        return;
    }
    final RenderBlocks renderer = (RenderBlocks)data[0];
    Entity holder = null;
    if (data.length > 1 && data[1] instanceof Entity) {
        holder = (Entity)data[1];
    }
    if (holder == null) {
        holder = (Entity)Minecraft.getMinecraft().thePlayer;
    }
    final Tessellator var4 = Tessellator.instance;
    block.setBlockBoundsForItemRender();
    renderer.setRenderBoundsFromBlock(block);
    GL11.glRotatef(90.0f, 0.0f, 1.0f, 0.0f);
    switch (type) {
        case EQUIPPED:
        case EQUIPPED_FIRST_PERSON: {
            GL11.glTranslatef(-1.0f, 0.5f, 0.0f);
            break;
        }
        default: {
            GL11.glTranslatef(-0.5f, -0.0f, -0.5f);
            break;
        }
    }
    OpenGlHelper.glBlendFunc(770, 771, 1, 0);
    GL11.glEnable(3008);
    RenderBlockDrum.drawInvBlock(block, item);
    GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f);
    GL11.glTranslatef(0.5f, 0.0f, 0.5f);
}