Skip to content

Conversation

@ItsNature
Copy link
Collaborator

@ItsNature ItsNature commented Oct 22, 2025

Overview

Description:
Introduce the Mod Status API to the Mod Settings Module, allowing server developers to retrieve the current values of a player's Lunar Client mod settings.

Changes:

  • Added ModSettingModule#getStatus(ApolloPlayer, Option)
  • Added ApolloUpdateModOptionEvent event that is triggered when a player updates a mod option, providing the player, option, and new value.
  • Added Option#get(UUID, Option) and Option#getDirect(UUID, Option).
  • Bumped the apollo-protos version to 0.0.4.
  • Updated the documentation for the Mod Setting module and Events to include the new features.

Code Example

// How to retrieve the current value of a mod option for a player
private final ModSettingModule modSettingModule = Apollo.getModuleManager().getModule(ModSettingModule.class);

private void printOptionStatusExample(Player player) {
    Optional<ApolloPlayer> apolloPlayerOpt = Apollo.getPlayerManager().getPlayer(player.getUniqueId());
    apolloPlayerOpt.ifPresent(apolloPlayer -> {
        boolean waypointsEnabled = this.modSettingModule.getStatus(apolloPlayer, ModWaypoints.ENABLED);
        float minimapScale = this.modSettingModule.getStatus(apolloPlayer, ModMinimap.SCALE);
        int fovDefaultFov = this.modSettingModule.getStatus(apolloPlayer, ModFov.DEFAULT_FOV);

        apolloPlayer.sendMessage(Component.text("Waypoints Enabled: ").append(Component.text(waypointsEnabled)));
        apolloPlayer.sendMessage(Component.text("Minimap Scale: ").append(Component.text(minimapScale)));
        apolloPlayer.sendMessage(Component.text("Fov Default Fov: ").append(Component.text(fovDefaultFov)));
    });
}

// How to listen for mod option updates
@Listen
private void onApolloUpdateModOption(ApolloUpdateModOptionEvent event) {
    event.getPlayer().sendMessage(Component.text(event.getOption().getKey())
        .append(Component.text(" was updated to "))
        .append(Component.text(Objects.toString(event.getValue()))));
}

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)

@ItsNature ItsNature added type: Documentation Documentation improvement or issue type: Enhancement Feature improvement or addition labels Oct 22, 2025
@ItsNature ItsNature mentioned this pull request Oct 23, 2025
@ItsNature ItsNature merged commit 1322563 into version/1.2.1 Nov 21, 2025
1 check passed
@ItsNature ItsNature deleted the feature/mod-status branch November 21, 2025 01:58
ItsNature added a commit that referenced this pull request Dec 16, 2025
* Deploy as 1.2.1-SNAPSHOT

* Restructure platform modules (#236)

* add a parent platform gradle module

* add readme banner

* Add a few gh badges

* remove build tools

---------

Co-authored-by: Trentin <25537885+TrentinTheKid@users.noreply.github.com>

* Bump bungee to 1.21-R0.4 (#240)

* Option: Add static enum builder method (#239)

- Like the other option types

* Sync LunarClient Mods & Options (#241)

* Sync LunarClient Mods & Options

* Update version tags to 1.2.1

---------

Co-authored-by: LunarClient Bot <lc-bot@moonsworth.com>

* Feature - Mod Status API (#243)

* Apollo Mod Status API

* Remove mod options loading logic from auto gen

* example: add mod status command

* Receive mod status from the handshake packet

* don't use WeakHashMap for options

* Markdown docs

* Fix hyperlinks

* Move mod status API into ModSettingsModule

* Option API improvements

* Remove debug

* add mod settings module tests

* Make global options protected

* Link mod available options in the mod status example

* example: remove debug

* Prepare for merge

* Feature - PayNow Module (#244)

* Add the pay now module

# Conflicts:
#	common/src/main/java/com/lunarclient/apollo/player/ApolloPlayerManagerImpl.java
#	docs/developers/lightweight/protobuf/getting-started.mdx
#	gradle/libs.versions.toml

* Fix import order

* Update example message

* Paynow docs

* Dont deploy this branch

* Bump to 1.2.1 (#245)

---------

Co-authored-by: Trentin <25537885+TrentinTheKid@users.noreply.github.com>
Co-authored-by: Fx Morin <28154542+FxMorin@users.noreply.github.com>
Co-authored-by: LunarClient Bot <lc-bot@moonsworth.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: Documentation Documentation improvement or issue type: Enhancement Feature improvement or addition

Development

Successfully merging this pull request may close these issues.

4 participants