Configurable aliases for the /sellgui command#26
Open
RapahelS wants to merge 3 commits intoMackenzieMolloy:masterfrom
Open
Configurable aliases for the /sellgui command#26RapahelS wants to merge 3 commits intoMackenzieMolloy:masterfrom
/sellgui command#26RapahelS wants to merge 3 commits intoMackenzieMolloy:masterfrom
Conversation
…d readability and performance
… 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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces support for custom command aliases for the
/sellguicommand, 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:
CommandRegistrarutility class to programmatically register custom command aliases defined in the configuration, ensuring they are mapped to the mainsellguicommand and its executor/tab completer. (CommandRegistrar.java)SellGUIplugin initialization to invoke alias registration on enable. (SellGUI.java)Event Handling:
SellCommandListenerto intercept player command input, cancel execution if the command matches a configured alias, and reroute it to the mainsellguicommand for consistent handling. (SellCommandListener.java)SellGUI.java)Configuration:
config.ymlto allow server admins to specify custom command aliases underoptions.commands.aliases. (config.yml)