Java Code Examples for net.minecraft.block.Block#setBlockBounds()

The following examples show how to use net.minecraft.block.Block#setBlockBounds() . 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: BlockExtendedNodeJarRenderer.java    From Gadomancy with GNU Lesser General Public License v3.0 6 votes vote down vote up
@Override
public void renderInventoryBlock(Block block, int metadata, int modelID, RenderBlocks renderer) {
    GL11.glPushMatrix();
    GL11.glEnable(3042);
    GL11.glBlendFunc(770, 771);
    Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.locationBlocksTexture);
    IIcon i1 = ((BlockJar) ConfigBlocks.blockJar).iconJarTop;
    IIcon i2 = ((BlockJar) ConfigBlocks.blockJar).iconJarSide;
    block.setBlockBounds(W3, 0.0F, W3, W13, W12, W13);
    renderer.setRenderBoundsFromBlock(block);
    drawFaces(renderer, block, ((BlockJar) ConfigBlocks.blockJar).iconJarBottom, i1, i2, i2, i2, i2, true);
    block.setBlockBounds(W5, W12, W5, W11, W14, W11);
    renderer.setRenderBoundsFromBlock(block);
    drawFaces(renderer, block, ((BlockJar) ConfigBlocks.blockJar).iconJarBottom, i1, i2, i2, i2, i2, true);
    GL11.glPopMatrix();
}
 
Example 2
Source File: BlockExtendedNodeJarRenderer.java    From Gadomancy with GNU Lesser General Public License v3.0 6 votes vote down vote up
@Override
public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) {
    int bb = setBrightness(world, x, y, z, block);
    int metadata = world.getBlockMetadata(x, y, z);
    block.setBlockBounds(W3, 0.0F, W3, W13, W12, W13);
    renderer.setRenderBoundsFromBlock(block);
    renderer.renderStandardBlock(block, x, y, z);
    block.setBlockBounds(W5, W12, W5, W11, W14, W11);
    renderer.setRenderBoundsFromBlock(block);
    renderer.renderStandardBlock(block, x, y, z);

    renderer.clearOverrideBlockTexture();
    block.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
    renderer.setRenderBoundsFromBlock(block);
    return true;
}
 
Example 3
Source File: BW_Renderer_Block_Ores.java    From bartworks with MIT License 5 votes vote down vote up
@Override
public void renderInventoryBlock(Block aBlock, int aMeta, int modelId, RenderBlocks aRenderer) {
    BW_MetaGenerated_Block_TE tTileEntity = ((BW_MetaGenerated_Blocks)aBlock).getProperTileEntityForRendering();
    tTileEntity.mMetaData = (short) aMeta;
    aBlock.setBlockBoundsForItemRender();
    aRenderer.setRenderBoundsFromBlock(aBlock);
    GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F);
    GL11.glTranslatef(-0.5F, -0.5F, -0.5F);
    Tessellator.instance.startDrawingQuads();
    Tessellator.instance.setNormal(0.0F, -1.0F, 0.0F);
    renderNegativeYFacing(null, aRenderer, aBlock, 0, 0, 0, tTileEntity.getTexture(aBlock, (byte) 0), true);
    Tessellator.instance.draw();
    Tessellator.instance.startDrawingQuads();
    Tessellator.instance.setNormal(0.0F, 1.0F, 0.0F);
    renderPositiveYFacing(null, aRenderer, aBlock, 0, 0, 0, tTileEntity.getTexture(aBlock, (byte) 1), true);
    Tessellator.instance.draw();
    Tessellator.instance.startDrawingQuads();
    Tessellator.instance.setNormal(0.0F, 0.0F, -1.0F);
    renderNegativeZFacing(null, aRenderer, aBlock, 0, 0, 0, tTileEntity.getTexture(aBlock, (byte) 2), true);
    Tessellator.instance.draw();
    Tessellator.instance.startDrawingQuads();
    Tessellator.instance.setNormal(0.0F, 0.0F, 1.0F);
    renderPositiveZFacing(null, aRenderer, aBlock, 0, 0, 0, tTileEntity.getTexture(aBlock, (byte) 3), true);
    Tessellator.instance.draw();
    Tessellator.instance.startDrawingQuads();
    Tessellator.instance.setNormal(-1.0F, 0.0F, 0.0F);
    renderNegativeXFacing(null, aRenderer, aBlock, 0, 0, 0, tTileEntity.getTexture(aBlock, (byte) 4), true);
    Tessellator.instance.draw();
    Tessellator.instance.startDrawingQuads();
    Tessellator.instance.setNormal(1.0F, 0.0F, 0.0F);
    renderPositiveXFacing(null, aRenderer, aBlock, 0, 0, 0, tTileEntity.getTexture(aBlock, (byte) 5), true);
    Tessellator.instance.draw();
    aBlock.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
    aRenderer.setRenderBoundsFromBlock(aBlock);
    GL11.glTranslatef(0.5F, 0.5F, 0.5F);
}
 
Example 4
Source File: Cuboid6.java    From CodeChickenLib with GNU Lesser General Public License v2.1 4 votes vote down vote up
public void setBlockBounds(Block block) {
    block.setBlockBounds((float) min.x, (float) min.y, (float) min.z, (float) max.x, (float) max.y, (float) max.z);
}