Skip to content

StaffMod Module Improvements - Add enabledByDefault#296

Merged
ItsNature merged 3 commits into
version/1.2.8from
improvement/staffmod-enable-by-default
Jun 25, 2026
Merged

StaffMod Module Improvements - Add enabledByDefault#296
ItsNature merged 3 commits into
version/1.2.8from
improvement/staffmod-enable-by-default

Conversation

@ItsNature

@ItsNature ItsNature commented Jun 23, 2026

Copy link
Copy Markdown
Collaborator

Overview

Description:
Adds an enabledByDefault parameter to the Staff Mod Module's enable methods so servers can choose whether granting a staff mod also activates it on the player's client.

Changes:

  • New methods on StaffModModule:
    • StaffModModule#enableStaffMods(Recipients, List<StaffMod>, boolean enabledByDefault)
    • StaffModModule#enableAllStaffMods(Recipients, boolean enabledByDefault)
  • The existing no-flag overloads delegate with enabledByDefault set as false.

Code Example:

  public void enableStaffModsExample(Player viewer) {
      if (!viewer.hasPermission("apollo.staff")) {
          return;
      }

      Optional<ApolloPlayer> apolloPlayerOpt = Apollo.getPlayerManager().getPlayer(viewer.getUniqueId());
      apolloPlayerOpt.ifPresent(apolloPlayer -> this.staffModModule.enableStaffMods(apolloPlayer, Collections.singletonList(StaffMod.XRAY), true));
  }

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)

…t)` & `StaffModModule#enableAllStaffMods(recipients, enabledByDefault)`
@ItsNature ItsNature added type: Documentation Documentation improvement or issue type: Enhancement Feature improvement or addition labels Jun 23, 2026
@ItsNature ItsNature mentioned this pull request Jun 23, 2026
@ItsNature ItsNature merged commit f53ffa5 into version/1.2.8 Jun 25, 2026
1 check passed
@ItsNature ItsNature deleted the improvement/staffmod-enable-by-default branch June 25, 2026 00:19
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.

3 participants