Skip to content

Conversation

@ItsNature
Copy link
Collaborator

@ItsNature ItsNature commented Aug 11, 2025

Overview

Description:
Adds a CLEAR_TITLE_ON_SERVER_SWITCH option to the Title Module allowing titles to be automatically cleared when a player switches servers.

Changes:
Available options

  • CLEAR_TITLE_ON_SERVER_SWITCH
    • Determines whether the players displayed title should clear when switching servers.
    • Values
      • Type: Boolean
      • Default: false

Code Example

API

public void setClearTitleOnServerSwitch(boolean value) {
    this.titleModule.getOptions().set(TitleModule.CLEAR_TITLE_ON_SERVER_SWITCH, value);
}

Lightweight

Proto

public void setClearTitleOnServerSwitch(boolean value) {
    Map<String, Value> properties = new HashMap<>();
    properties.put("clear-title-on-server-switch", Value.newBuilder().setBoolValue(value).build());

    ConfigurableSettings settings = ProtobufPacketUtil.createModuleMessage("title", properties);
    ProtobufPacketUtil.broadcastPacket(settings);
}

JSON

public void setClearTitleOnServerSwitch(boolean value) {
    Map<String, Object> properties = new HashMap<>();
    properties.put("clear-title-on-server-switch", value);

    JsonObject message = JsonUtil.createEnableModuleObjectWithType("title", properties);
    JsonPacketUtil.broadcastPacket(message);
}

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 the type: Enhancement Feature improvement or addition label Aug 11, 2025
@ItsNature ItsNature mentioned this pull request Aug 11, 2025
@ItsNature ItsNature merged commit f75ec91 into version/1.1.9 Aug 11, 2025
2 checks passed
@ItsNature ItsNature deleted the feature/title-reset-on-server-switch branch August 11, 2025 21:32
ItsNature added a commit that referenced this pull request Sep 3, 2025
* Deploy as 1.1.9-SNAPSHOT

* Glow Module - Add Scoreborard Team Color Fallback (#209)

* Add documentation & API method for scoreboard color fallback

* Add info callout for scoreboard team color

* chore: update to new Maven repo (#212)

* chore: update to new Maven repo

* fix: use specific proto version

* docs: update apollo-protos versions

---------

Co-authored-by: ItsNature <matej.bucaric@gmail.com>

* Update summon command examples (#211)

* Improvement - Include the packet sender in Packet Enrichment Events (#220)

* Add sender to Packet Enrichment events

* Add the sender field to the event documentation

* Title Module - Add a option to clear the title on server switch (#223)

* Add `CLEAR_TITLE_ON_SERVER_SWITCH` option to the Title Module

* Add example docs

* Add `clearOnServerSwitch` parameter to the Title example command

* Update format

* Add documentation & code example for new inventory module tags (#217)

* Sync LunarClient Mods & Options (#226)

* Sync LunarClient Mods & Options

* Update version tags to 1.1.9

---------

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

* Delete deploy script (#224)

* example: restructure gradle modules (#228)

* Feature - User Metadata (#225)

* Bukkit and bungee impl

* finish bungee impl

* Velocity & Folia impl

* Remove debug

* fix brand collecting on bukkit & bungee

* Bump to 1.1.9 (#227)

---------

Co-authored-by: Colin McDonald <colin@colinmcdonald.me>
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: Enhancement Feature improvement or addition

Development

Successfully merging this pull request may close these issues.

4 participants