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.
SpongeAPI | Sponge Impl
While I've got a minute...
Introduces
ValueParameter.Simple
which is primarily used to allow the use of Mojang provided parameters that we wrap - they don't need to know about theCommandContext.Builder
so this allows third party frameworks to use the Mojang provided parameters.Note that aspirationally, at some point I might associate a
ClientCompletionKey
with each of these to make it clear what parameter links to what key - again, a QoL thing for third party consumers.This will fix the issue in Inherite from default parameters in a more restrictive way #2290 insofar as composition is concerned, though the next point will make that moot.
Adds a
ValueParameterModifier
that modifies the output/completions of a parameter. This is generally going to be easier than trying to recreate a parameter (such as entities) itself.I have not allowed for the transformation of parameter types. As well as it being difficult to do because of the more strongly typed system we have, it's not really encouraged that non-parsing logic should go in a parser - they should do the minimum to validate that a parameter is valid for the context - if a later parameter fails then the work in the parser is wasted and so it is best to do as much work as possible in the executor, when you have a guarantee that your transformations will be used.
This should be a better way of solving the issue in Inherite from default parameters in a more restrictive way #2290 and basically sidestep the problem in Missing ClientCompletionTypes #2289.