Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(brigadier): Duplicate literal nodes for each alias with Brigadier #91

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

metabrixkt
Copy link

Fixes #5

As #5 description states, literal node aliases work on command execution, but suggestions don't. As of v2, this is no longer the case (at least on Paper with the modern brig api). Neither suggestions nor running the command work with aliases. So...

  • I tested it and it works
  • Other possibly related code unaffected (like root node aliases), also tested
  • Both suggestions and execution now work properly

🥔

@broccolai
Copy link
Member

Brigadier doesn't support aliases, adding the command for each alias inflates the command tree (that's sent to the player) significantly

@jpenilla
Copy link
Member

jpenilla commented Aug 2, 2024

This is an intentional decision not to create exponentially massive command trees. Brigadier does not have any way to represent aliases and redirects are broken and inconsistent in many ways. If we were to accept something like this it would need to be a per-command-chain option, not entirely sure of the best way to implement that, however.

@jpenilla jpenilla changed the title fix(cloud-brigadier): Fix literal node aliases with Brigadier feat(cloud-brigadier): Duplicate literal nodes for each alias with Brigadier Aug 2, 2024
@jpenilla jpenilla changed the title feat(cloud-brigadier): Duplicate literal nodes for each alias with Brigadier feat(brigadier): Duplicate literal nodes for each alias with Brigadier Aug 2, 2024
@metabrixkt
Copy link
Author

If we were to accept something like this it would need to be a per-command-chain option, not entirely sure of the best way to implement that, however.

@jpenilla What about adding something like BrigadierSetting.LITERAL_NODE_ALIASES for this? With a note in the javadoc that it results in a massive command tree

@jpenilla
Copy link
Member

jpenilla commented Aug 2, 2024

BrigadierSettings is not a per-command-chain configuration.

@metabrixkt
Copy link
Author

metabrixkt commented Aug 2, 2024

BrigadierSettings is not a per-command-chain configuration.

Well, either way:

  • If a command doesn't have literal nodes with aliases, it doesn't need this configuration
  • If a command has literal nodes with aliases, it needs this configuration because literal aliases don't work in suggestions or during execution, otherwise there's no point in adding aliases, they don't work without it anyway

So what's the point of per-command-chain configuration?

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.

Command literal aliases do not work with Brigadier
3 participants