Skip to content

Feature - Server Links#261

Open
ItsNature wants to merge 11 commits intoversion/1.2.5from
feature/server-links
Open

Feature - Server Links#261
ItsNature wants to merge 11 commits intoversion/1.2.5from
feature/server-links

Conversation

@ItsNature
Copy link
Copy Markdown
Collaborator

@ItsNature ItsNature commented Mar 25, 2026

Overview

Description:
The server link module provides enhancements and additional support to the vanilla Minecraft server link feature. Which allows you to display important links to players in a dedicated UI.

  • Adds improvements to the existing server link features
  • Ability to set a custom image title resource for the server links menu

Backported legacy version support for all versions below 1.21

Full Docs: Server Link Module

Changes:

Code Example:
Override the Server Link Menu resource

public void overrideServerLinkResourceExample(Player viewer) {
    Optional<ApolloPlayer> apolloPlayerOpt = Apollo.getPlayerManager().getPlayer(viewer.getUniqueId());

    apolloPlayerOpt.ifPresent(apolloPlayer -> {
        this.serverLinkModule.overrideServerLinkResource(apolloPlayer, ResourceLocationIcon.builder()
            .resourceLocation("lunar:logo/logo-100x100.png")
            .build());
    });
}

Reset the Server Link Menu resource

public void resetServerLinkResourceExample(Player viewer) {
    Optional<ApolloPlayer> apolloPlayerOpt = Apollo.getPlayerManager().getPlayer(viewer.getUniqueId());
    apolloPlayerOpt.ifPresent(this.serverLinkModule::resetServerLinkResource);
}

Add Server Link

public void addServerLinkExample(Player viewer) {
    Optional<ApolloPlayer> apolloPlayerOpt = Apollo.getPlayerManager().getPlayer(viewer.getUniqueId());

    apolloPlayerOpt.ifPresent(apolloPlayer -> {
        this.serverLinkModule.addServerLink(apolloPlayer, Lists.newArrayList(
            ServerLink.builder()
                .id("website")
                .displayName(Component.text("Website", NamedTextColor.LIGHT_PURPLE))
                .url("https://www.lunarclient.com/")
                .build(),
            ServerLink.builder()
                .id("support")
                .displayName(Component.text("Support", NamedTextColor.AQUA))
                .url("https://support.lunarclient.com/")
                .build(),
            ServerLink.builder()
                .id("status")
                .displayName(Component.text("Status", NamedTextColor.RED))
                .url("https://status.lunarclient.com/")
                .build()
        ));
    });
}

Remove Server Link

public void removeServerLinkExample(Player viewer) {
    Optional<ApolloPlayer> apolloPlayerOpt = Apollo.getPlayerManager().getPlayer(viewer.getUniqueId());

    apolloPlayerOpt.ifPresent(apolloPlayer -> {
        this.serverLinkModule.removeServerLink(apolloPlayer, Lists.newArrayList(
            "website", "support", "status"
        ));
    });
}

Resetting all Server Links

public void resetServerLinksExample(Player viewer) {
    Optional<ApolloPlayer> apolloPlayerOpt = Apollo.getPlayerManager().getPlayer(viewer.getUniqueId());
    apolloPlayerOpt.ifPresent(this.serverLinkModule::resetServerLinks);
}

Screenshots and/or Videos:
overview


Review Request Checklist

  • Your code follows the style guidelines of this project.
  • I have performed a self-review of my code.
  • I have tested this change myself. (If applicable)
  • I have made corresponding changes to the documentation. (If applicable)
  • The branch name follows the projects naming conventions. (e.g. feature/add-module & bugfix/fix-issue)

Base automatically changed from version/1.2.4 to master March 27, 2026 00:13
@ItsNature ItsNature force-pushed the feature/server-links branch from 1a06038 to a97ca22 Compare March 27, 2026 00:19
@ItsNature ItsNature mentioned this pull request Apr 1, 2026
@ItsNature ItsNature force-pushed the feature/server-links branch from b67526c to f95e3bb Compare April 1, 2026 18:35
@ItsNature ItsNature changed the base branch from master to version/1.2.5 April 4, 2026 04:11
@ItsNature ItsNature marked this pull request as ready for review April 4, 2026 04:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants