Repository: PaperMC/Paper
File: paper-server/src/main/java/com/destroystokyo/paper/PaperVersionFetcher.java (Java)

Code before:
        final OptionalInt buildNumber = build.buildNumber();
        if (buildNumber.isEmpty() && build.gitCommit().isEmpty()) {
            COMPONENT_LOGGER.warn(text("*** You are running a development version without access to version information ***"));
        } else {
            if (buildNumber.isPresent()) {
                distance = fetchDistanceFromSiteApi(build, buildNumber.getAsInt());
                newVersion = fetchMinecraftVersionList(build);
            } else {
                final Optional<String> gitBranch = build.gitBranch();
                final Optional<String> gitCommit = build.gitCommit();
                if (gitBranch.isPresent() && gitCommit.isPresent()) {
                    distance = fetchDistanceFromGitHub(repo, gitBranch.get(), gitCommit.get());
                    newVersion = fetchMinecraftVersionList(build);
                }
            }

            switch (distance) {
                case DISTANCE_ERROR -> COMPONENT_LOGGER.error(text("*** Error obtaining version information! Cannot fetch version info ***"));
                case 0 -> {
                    if (!newVersionAvailable) {
                        COMPONENT_LOGGER.info(text("*** You are running the latest version! ***", NamedTextColor.GREEN));
                    } else {
                        COMPONENT_LOGGER.info(text("*************************************************************************************", NamedTextColor.GREEN));
                        COMPONENT_LOGGER.info(text("You are running the latest build for your Minecraft version (" + build.minecraftVersionName() + ")", NamedTextColor.GREEN));
                        COMPONENT_LOGGER.info(text("However, there is a new Minecraft version available on the downloads page (" + newVersion + ")!", NamedTextColor.GREEN));
                        COMPONENT_LOGGER.info(text("It is recommended that you download it as soon as possible (unless it is experimental)", NamedTextColor.GREEN));
                        COMPONENT_LOGGER.info(text(DOWNLOAD_PAGE, NamedTextColor.GREEN));
                        COMPONENT_LOGGER.info(text("*************************************************************************************", NamedTextColor.GREEN));
                    }
                }
                case DISTANCE_UNKNOWN -> COMPONENT_LOGGER.warn(text("*** You are running an unknown version! Cannot fetch version info ***"));
                case 5 -> {
                    COMPONENT_LOGGER.error(text("*** You are " + distance + " builds behind! ***"));
                    COMPONENT_LOGGER.error(text("*** Please download a new build from " + DOWNLOAD_PAGE + " ***"));
                    if (newVersionAvailable) {
                        COMPONENT_LOGGER.error(text("*** Also note that a new Minecraft version has been released (" + newVersion + ")! ***"));
                    }
                }
                default -> {
                    if (!newVersionAvailable) {
                        COMPONENT_LOGGER.warn(text("*** Currently you are " + distance + " build(s) behind ***"));
                        COMPONENT_LOGGER.warn(text("*** It is highly recommended to download a new build from " + DOWNLOAD_PAGE + " ***"));
                    } else {
                        COMPONENT_LOGGER.error(text("*** Currently you are " + distance + " build(s) behind ***"));
                        COMPONENT_LOGGER.error(text("*** It is highly recommended to download a new build from " + DOWNLOAD_PAGE + " ***"));
                        COMPONENT_LOGGER.error(text("*** Also note that a new Minecraft version has been released (" + newVersion + ")! ***"));
                    }
                }
            };
        }
    }

Review comment (suggestion):
I think this line could be confusing. I'm also not entirely sure about the reminder in general. If someone is using an up-to-date stable version like 1.21.4, it might be annoying to receive warnings about newer versions that are still experimental, like 1.21.5 or 1.21.6.

I'd personally suggesst:
A. Implement a way to detect and exclude experimental versions from triggering this message, or
B. Consider removing this else block entirely.

Code after:

        return history != null ? Component.textOfChildren(updateMessage, Component.newline(), history) : updateMessage;
    }

    public static void getUpdateStatusStartupMessage() {
        int distance = DISTANCE_ERROR;

        final OptionalInt buildNumber = BUILD_INFO.buildNumber();
        if (buildNumber.isEmpty() && BUILD_INFO.gitCommit().isEmpty()) {
            COMPONENT_LOGGER.warn(text("*** You are running a development version without access to version information ***"));
        } else {
            final Optional<MinecraftVersionFetcher> apiResult = fetchMinecraftVersionList();
            if (buildNumber.isPresent()) {
                distance = fetchDistanceFromSiteApi(buildNumber.getAsInt());
            } else {
                final Optional<String> gitBranch = BUILD_INFO.gitBranch();
                final Optional<String> gitCommit = BUILD_INFO.gitCommit();
                if (gitBranch.isPresent() && gitCommit.isPresent()) {
                    distance = fetchDistanceFromGitHub(gitBranch.get(), gitCommit.get());
                }
            }

            switch (distance) {
                case DISTANCE_ERROR -> COMPONENT_LOGGER.error(text("*** Error obtaining version information! Cannot fetch version info ***"));
                case 0 -> apiResult.ifPresent(result -> {
                    COMPONENT_LOGGER.warn(text("*************************************************************************************"));
                    COMPONENT_LOGGER.warn(text("You are running the latest build for your Minecraft version (" + BUILD_INFO.minecraftVersionId() + ")"));
                    COMPONENT_LOGGER.warn(text("However, you are " + result.distance() + " release(s) behind the latest stable release (" + result.latestVersion() + ")!"));
                    COMPONENT_LOGGER.warn(text("It is recommended that you update as soon as possible"));
                    COMPONENT_LOGGER.warn(text(DOWNLOAD_PAGE));
                    COMPONENT_LOGGER.warn(text("*************************************************************************************"));
                });
                case DISTANCE_UNKNOWN -> COMPONENT_LOGGER.warn(text("*** You are running an unknown version! Cannot fetch version info ***"));
                default -> {
                    if (apiResult.isPresent()) {
                        COMPONENT_LOGGER.warn(text("*** You are running an outdated version of Minecraft, which is " + apiResult.get().distance() + " release(s) and " + distance + " build(s) behind!"));
                        COMPONENT_LOGGER.warn(text("*** Please update to the latest stable version on " + DOWNLOAD_PAGE + " ***"));
                    } else {
                        COMPONENT_LOGGER.info(text("*** Currently you are " + distance + " build(s) behind ***"));
                        COMPONENT_LOGGER.info(text("*** It is highly recommended to download the latest build from " + DOWNLOAD_PAGE + " ***"));
                    }
                }
            }
        }
    }

    private static Component getUpdateStatusMessage() {
        int distance = DISTANCE_ERROR;

        final OptionalInt buildNumber = PaperVersionFetcher.BUILD_INFO.buildNumber();
        if (buildNumber.isPresent()) {