forked from PaperMC/Velocity
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix serialization of arguments node, aliases are now redirects...
The vanilla client doesn't know how to serialize the ArgumentTypes used by the invocation factories (see StringArrayArgumentType). ArgumentsCommandNode looks like an ArgumentCommandNode<S, String> but works like an ArgumentCommandNode<S, T>, where T is the type expected by each Command implementation. This allows for efficient parsing (just one arguments parse per execution/suggestion). PaperMC/velocity-brigadier#7 allows us to create "cheap" hinting nodes, i.e. they have a dummy #requires that returns false. Before, we needed to set the Command, requirements, suggestions... This allows for separation of concerns. The clone is still needed to set this requirement, however. PaperMC/velocity-brigadier#8 is perhaps the biggest change: we now use Brigadier redirects for command aliases. This means we no longer have to perform a deep clone of all hints and the arguments node, which can save lots of memory for hint-heavy commands and commands with lots of aliases (e.g. LuckPerms). This comes at a cost of a reference in each CommandContextBuilder and CommandContext object, which get allocated for each suggestion to test the context-aware predicate.
- Loading branch information
1 parent
9b619bf
commit ae4bbd8
Showing
4 changed files
with
119 additions
and
46 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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