Add MANY_GAME_PROFILES parameter, repurpose GAME_PROFILE to only return one.#2240
Merged
Add MANY_GAME_PROFILES parameter, repurpose GAME_PROFILE to only return one.#2240
Conversation
749ee99 to
2c7ee1d
Compare
This was referenced Jan 9, 2022
build: Update dependency org.spongepowered:spongeapi to v8
IntellectualSites/FastAsyncWorldEdit#1531
Closed
1 task
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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 | SpongeCommon
This is kind of me updating/fixing/thinking about things as I write Nucleus for API 8.
Two reasons I've made this a PR specifically:
CollectioninParameter.Value<>and whether we want to think about that a little - this is a thought that's come to mind as I've been building Nucleus for API 8.On that latter point, we have some
Parameter.Valuesthat returnCollection<T>rather than justT.It can be argued that this is a good thing in that it clearly specifies whether a parameter will potentially return multiple entries or not. However, it might be confusing when it comes to
CommandContext#getOnevs.CommandContext#getAll. When this parameter value/key is used in these methods, they will returnCollection<T>andCollection<Collection<T>>, and this might be confusing to some people used to the old system.As an example, say we have the following parameter:
If we specify this once in a command then invoke the command, to get it from the resulting context, we'd need to use the
requireOnemethod:This makes sense because you're getting one parsed result. However, if you were to have this parameter twice (or more) in the command, you'd use
getAll...As you can see, you get a collection of collections. While this makes sense as what you're doing is getting multiple result sets from the separate parameters, it might trip people up and I just wonder if this is really what we should be doing. Do we want to perhaps remove the notion of
Collectionfrom some of these value parameters and basically assume that all parameters can return multiple values, or do we want to enforce returning aCollectionwhen we could be returning multiple values?I think I like the latter. I'd just have to make some of the javadocs and docs examples (when I write them) clear about what's going on.
(I'm also not inclined to change it because a) it's getting late in the API cycle and b) it would actually be painful to implement because of the way Brig works and how I'm trying to keep some sembelence of compatibility. I thought I'd mention it, however, because it also gives some context to the change I'm making in the first place!)
I'll merge this when registry changes are done or if Zidane is willing to add this into his changes.