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

The following examples show how to use net.minecraft.client.renderer.RenderBlocks#renderBlockAsItem() . 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: BlockTexturedOreRenderer.java    From Chisel-2 with GNU General Public License v2.0 6 votes vote down vote up
@Override
public void renderInventoryBlock(Block blck, int meta, int modelID, RenderBlocks renderer) {
	if (blck == null || !(blck instanceof BlockTexturedOre))
		return;

	BlockTexturedOre block = (BlockTexturedOre) blck;

	if (block.icon != null) {
		renderer.overrideBlockTexture = block.icon;
		renderer.renderBlockAsItem(Blocks.stone, meta, 1.0f);
		renderer.overrideBlockTexture = null;
	} else if (block.base != null) {
		renderer.renderBlockAsItem(block.base, meta, 1.0f);
	}

	GL11.glEnable(3042);
	GL11.glBlendFunc(770, 771);
	renderer.setRenderBounds(bot, bot, bot, top, top, top);
	GL11.glTranslatef(-0.5F, -0.5F, -0.5F);
	Drawing.drawBlock(block, meta, renderer);
	GL11.glDisable(3042);
}
 
Example 2
Source File: RendererMultiLayer.java    From Chisel-2 with GNU General Public License v2.0 6 votes vote down vote up
@Override
public void renderInventoryBlock(Block blck, int meta, int modelID, RenderBlocks renderer) {
	if (blck == null || !(blck instanceof BlockMultiLayerBase))
		return;

	BlockMultiLayerBase block = (BlockMultiLayerBase) blck;

	if (block.icon != null) {
		renderer.overrideBlockTexture = block.icon;
		renderer.renderBlockAsItem(Blocks.stone, meta, 1.0f);
		renderer.overrideBlockTexture = null;
	} else if (block.base != null) {
		renderer.renderBlockAsItem(block.base, meta, 1.0f);
	}
	
	glPushMatrix();
	glEnable(GL_BLEND);
	glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
	renderer.setRenderBounds(bot, bot, bot, top, top, top);
	glTranslatef(-0.5F, -0.5F, -0.5F);
	Drawing.drawBlock(block, meta, renderer);
	glDisable(GL_BLEND);
	glPopMatrix();
}
 
Example 3
Source File: BlockTexturedOreRenderer.java    From Chisel with GNU General Public License v2.0 6 votes vote down vote up
@Override
public void renderInventoryBlock(Block blck, int meta, int modelID, RenderBlocks renderer)
{
    if(blck == null || !(blck instanceof BlockTexturedOre))
        return;

    BlockTexturedOre block = (BlockTexturedOre) blck;

    if(block.icon != null)
    {
        renderer.overrideBlockTexture = block.icon;
        renderer.renderBlockAsItem(Blocks.stone, meta, 1.0f);
        renderer.overrideBlockTexture = null;
    } else if(block.base != null)
    {
        renderer.renderBlockAsItem(block.base, meta, 1.0f);
    }

    GL11.glEnable(3042);
    GL11.glBlendFunc(770, 771);
    renderer.setRenderBounds(bot, bot, bot, top, top, top);
    GL11.glTranslatef(-0.5F, -0.5F, -0.5F);
    Drawing.drawBlock(block, meta, renderer);
    GL11.glDisable(3042);
}
 
Example 4
Source File: BlockTexturedOreRenderer.java    From Chisel with GNU General Public License v2.0 6 votes vote down vote up
@Override
public void renderInventoryBlock(Block blck, int meta, int modelID, RenderBlocks renderer)
{
    if(blck == null || !(blck instanceof BlockTexturedOre))
        return;

    BlockTexturedOre block = (BlockTexturedOre) blck;

    if(block.icon != null)
    {
        renderer.overrideBlockTexture = block.icon;
        renderer.renderBlockAsItem(Blocks.stone, meta, 1.0f);
        renderer.overrideBlockTexture = null;
    } else if(block.base != null)
    {
        renderer.renderBlockAsItem(block.base, meta, 1.0f);
    }

    GL11.glEnable(3042);
    GL11.glBlendFunc(770, 771);
    renderer.setRenderBounds(bot, bot, bot, top, top, top);
    GL11.glTranslatef(-0.5F, -0.5F, -0.5F);
    Drawing.drawBlock(block, meta, renderer);
    GL11.glDisable(3042);
}
 
Example 5
Source File: ChunkLoaderSBRH.java    From ChickenChunks with MIT License 5 votes vote down vote up
@Override
public void renderInventoryBlock(Block block, int metadata, int modelID, RenderBlocks renderer)
{
    if(block != ChickenChunks.blockChunkLoader)
        return;

    ChickenChunks.blockChunkLoader.setBlockBoundsForItemRender(metadata);
    int actualRenderID = renderID;
    renderID = 0;
    renderer.renderBlockAsItem(block, metadata, 1);
    renderID = actualRenderID;
}
 
Example 6
Source File: RenderCarvableBeacon.java    From Chisel-2 with GNU General Public License v2.0 4 votes vote down vote up
@Override
public void renderInventoryBlock(Block block, int metadata, int modelId, RenderBlocks renderer) {
	renderer.renderBlockAsItem(Blocks.beacon, 0, 1);
}
 
Example 7
Source File: RenderCoverPlate.java    From Artifacts with MIT License 4 votes vote down vote up
@Override
public void renderInventoryBlock(Block block, int metadata, int modelID, RenderBlocks renderer) {
	renderer.renderBlockAsItem(PseudoCoverplate.instance, 0, 1.0F);
}
 
Example 8
Source File: RenderFakeBlock.java    From Artifacts with MIT License 4 votes vote down vote up
@Override
public void renderInventoryBlock(Block block, int metadata, int modelID, RenderBlocks renderer) {
	renderer.renderBlockAsItem(PseudoBlockIllusionary.instance, 3, 1.0F);
}
 
Example 9
Source File: RenderArrowTrap.java    From Artifacts with MIT License 2 votes vote down vote up
@Override
public void renderInventoryBlock(Block block, int metadata, int modelID, RenderBlocks renderer) {
	
	renderer.renderBlockAsItem(PseudoBlockTrap.instance, 0, 1.0f);

}