@Override
    public final void render(int var1, int var2) {
        var1 = getBlockOnScreen(var1, var2);
        if (defaultSizeBlocks) {
            drawFadingBox(width / 2 - 140, 30, width / 2 + 140, 195, -1878719232, -1070583712);
        } else {
            drawFadingBox(width / 2 - 140, 30, width / 2 + 140, 180, -1878719232, -1070583712);
        }
        if (var1 >= 0) {
            var2 = width / 2 + var1 % blocksPerRow * spacing + -128;
            if (defaultSizeBlocks) {
                drawCenteredString(fontRenderer, getBlockName(var1), width / 2, 180, 16777215);
            } else {
                drawCenteredString(fontRenderer, getBlockName(var1), width / 2, 165, 16777215);
            }
        }

        drawCenteredString(fontRenderer, "Select block", width / 2, 40, 16777215);
        TextureManager textureManager = minecraft.textureManager;
        ShapeRenderer shapeRenderer = ShapeRenderer.instance;
        var2 = textureManager.load(Textures.TERRAIN);
        GL11.glBindTexture(3553, var2);

        for (int i = 0; i < SessionData.allowedBlocks.size(); ++i) {
            Block block = SessionData.allowedBlocks.get(i);
            if (block != null) {
                GL11.glPushMatrix();
                int var5 = width / 2 + i % blocksPerRow * spacing + -128;
                int var6 = height / 2 + i / blocksPerRow * spacing + -60;
                GL11.glTranslatef(var5, var6, 0F);
                GL11.glScalef(9F, 9F, 9F);
                GL11.glTranslatef(1F, 0.5F, 8F);
                GL11.glRotatef(-30F, 1F, 0F, 0F);
                GL11.glRotatef(45F, 0F, 1F, 0F);
                if (var1 == i) {
                    GL11.glScalef(1.6F, 1.6F, 1.6F);
                    GL11.glRotatef(lastRotation, 0F, 1F, 0F);
                }

                GL11.glTranslatef(-1.5F, 0.5F, 0.5F);
                GL11.glScalef(-1F, -1F, -1F);
                shapeRenderer.begin();
                block.renderFullBrightness(shapeRenderer);
                shapeRenderer.end();
                GL11.glPopMatrix();
            }
        }

    }