@Override
    public final void render(int var1, int var2) {
        String titlePrint = ProgressBarDisplay.title;
        if (minecraft.session == null) {
            titlePrint = "Singleplayer";
        }

        drawFadingBox(0, 0, width, height, 1610941696, -1607454624);
        drawCenteredString(fontRenderer, "Game menu", width / 2, 40, 16777215);
        drawString(fontRenderer, titlePrint, width - fontRenderer.getWidth(titlePrint) - 15, 2,
                16777215);
        drawString(fontRenderer, "ClassiCube " + VersionString,
                width - fontRenderer.getWidth("ClassiCube " + VersionString) - 15, 13, 14474460);

        double cpuUsage = minecraft.monitoringThread.getAverageUsagePerCPU();
        double roundedCpuUsage = Math.round(cpuUsage * 100.0) / 100.0;

        int colorToUse = greenColor;
        if (cpuUsage >= 21) {
            colorToUse = orangeColor;
        } else if (cpuUsage >= 32) {
            colorToUse = redColor;
        } else if (cpuUsage <= 20) {
            colorToUse = greenColor;
        }

        String s = "Average CPU: " + roundedCpuUsage + "%";
        drawString(fontRenderer, s, width - fontRenderer.getWidth(s) - 15, 24, colorToUse);

        long dMem = minecraft.monitoringThread.totalMemory - minecraft.monitoringThread.freeMemory;
        float percent = dMem * 100L / minecraft.monitoringThread.maxMemory;
        if (percent >= 75) {
            colorToUse = redColor;
        } else if (percent >= 50) {
            colorToUse = orangeColor;
        } else {
            colorToUse = greenColor;
        }

        String Usage = "Used memory: " + percent + "% (" + dMem / 1024L / 1024L + "MB)";
        drawString(fontRenderer, Usage, width - fontRenderer.getWidth(Usage) - 15, 35, colorToUse);
        String max = "Allocated memory: " + minecraft.monitoringThread.maxMemory / 1024L / 1024L
                + "MB";
        drawString(fontRenderer, max, width - fontRenderer.getWidth(max) - 15, 46, 15132260);
        super.render(var1, var2);
    }