net.minecraft.block.BlockDirectional Java Examples

The following examples show how to use net.minecraft.block.BlockDirectional. 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: QCraftProxyClient.java    From qcraft-mod with Apache License 2.0 5 votes vote down vote up
@Override
public boolean renderWorldBlock( IBlockAccess world, int i, int j, int k, Block block, int modelID, RenderBlocks renderblocks )
{
    if( modelID == QCraft.Blocks.quantumLogic.blockRenderID )
    {
        int metadata = world.getBlockMetadata( i, j, k );
        int direction = BlockDirectional.getDirection( metadata );
        int subType = ( (BlockQuantumLogic) block ).getSubType( metadata );

        // Draw Base
        switch( direction )
        {
            case 0:
                renderblocks.uvRotateTop = 0;
                break;
            case 1:
                renderblocks.uvRotateTop = 1;
                break;
            case 2:
                renderblocks.uvRotateTop = 3;
                break;
            case 3:
                renderblocks.uvRotateTop = 2;
                break;
        }
        renderblocks.setRenderBoundsFromBlock( block );
        renderblocks.renderStandardBlock( block, i, j, k );
        renderblocks.uvRotateTop = 0;

        return true;
    }
    return false;
}