Skip to content

Configurable aliases for the /sellgui command#26

Open
RapahelS wants to merge 3 commits intoMackenzieMolloy:masterfrom
RapahelS:master
Open

Configurable aliases for the /sellgui command#26
RapahelS wants to merge 3 commits intoMackenzieMolloy:masterfrom
RapahelS:master

Conversation

@RapahelS
Copy link

This pull request introduces support for custom command aliases for the /sellgui command, allowing server administrators to define alternative command names that trigger the same functionality. It also adds a listener to intercept these aliases and ensures the correct command execution flow. The changes are grouped into command alias registration, event handling, and configuration updates.

Command Alias Registration:

  • Added CommandRegistrar utility class to programmatically register custom command aliases defined in the configuration, ensuring they are mapped to the main sellgui command and its executor/tab completer. (CommandRegistrar.java)
  • Updated SellGUI plugin initialization to invoke alias registration on enable. (SellGUI.java)

Event Handling:

  • Introduced SellCommandListener to intercept player command input, cancel execution if the command matches a configured alias, and reroute it to the main sellgui command for consistent handling. (SellCommandListener.java)
  • Registered the new listener during plugin enable. (SellGUI.java)

Configuration:

  • Extended config.yml to allow server admins to specify custom command aliases under options.commands.aliases. (config.yml)

RapahelS and others added 3 commits December 5, 2025 01:13
… improved readability and performance"

This reverts commit 07d80f7.
- Added CommandRegistrar to dynamically register aliases from config
- Added SellCommandListener to intercept no-arg alias commands (e.g. /sell) to open GUI
- Updated config.yml with default aliases (sell, sg, sellg)
- Ensures fallback to other plugins if arguments are provided to aliases
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant