Skip to content

Conversation

@Lemvs
Copy link
Contributor

@Lemvs Lemvs commented Nov 1, 2025

I've introduced an option that lets you toggle whether we want to use the default command aliases or only those set as command-aliases.

I've tried implementing this several times, but something always went wrong. Only after you added the CommandsMap.clearCommands() method today did I finally succeed. I know it might not be perfect, so please review it carefully and tell me what to modify to improve performance.

I've included the ability to modify aliases while the server is running, so for example, I've modified CommandsManagerImpl.commandsCooldown to store SuperiorCommand instead of String.

Unfortunately, the usage of commands also stores labels, so it's a bit of a hassle to modify them in CommandsHelper, but everything works fine.

Let me know what you think @OmerBenGera , this option will definitely be useful to many people, so it would be good if it could be merged after any fixes 😃

@Lemvs
Copy link
Contributor Author

Lemvs commented Nov 2, 2025

I received suggestions that it would be useful for such an option to be enabled only for some command, and that's right, it makes sense, but it would require reworking this section, so maybe it's better to completely move the configuration of commands from the config to another file, like commands.yml, which by default would contain all the commands with default values (with the old options from the config migrated) and would allow you to change new options, such as the default aliases (you could delete those added to the file by default and add your own), permission or even arguments - for example, if we want the /is bank command to have an alias [logs], what permission is required for it, etc. It could look like this:

commands:
  bank:
    enabled: true
    permission: superior.island.bank
    cooldown: 0
    aliases:
    - bank
    - vault
    arguments:
      logs:
        enabled: true
        aliases:
        - logs
...

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