Feat/configurable command forwarding #1692
Open
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.
Currently if you have the following command
/rootand/root childget forwarded to the backend and handled there, but/root nonexistantgets handled on the proxy. This is because the former cause "UnknownCommand" exceptions, and the later causes an "UnknownArgument" exception.The first commit in this PR aligns that behaviour, however this causes breakages in Simple/Raw commands as those assume they get handled on the proxy even if the user doesn't have the requisite permission. Which isn't true anymore if we are forwarding invocations that cause a "UnknownArgument" exception. this test fails for example.
Currently I have resolved this by adding an toggle in the CommandMeta that decides whether partially-matching commands such as the ones above should be forwarded. The default is
falseto ensure all Simple- and RawCommands keep working as expected. I assume this will also cause the least amount of breakage in people's Brigadier commands, but there will still be some.