Add mappings-latest function to Clojure sandbox#64
Open
SizableShrimp wants to merge 3 commits intotterrag1098:masterfrom
Open
Add mappings-latest function to Clojure sandbox#64SizableShrimp wants to merge 3 commits intotterrag1098:masterfrom
mappings-latest function to Clojure sandbox#64SizableShrimp wants to merge 3 commits intotterrag1098:masterfrom
Conversation
29d7b5a to
02c4e91
Compare
tterrag1098
requested changes
May 16, 2021
|
|
||
|
|
||
| public static CommandMappings<?> getMappingsCommand(String channel) { | ||
| switch (channel.toLowerCase(Locale.ROOT)) { |
Owner
There was a problem hiding this comment.
I'd say use this as a fallback, I see no reason why "mcp", "moj", etc would not be valid. Also what about yarn?
| final TypeBinding<MappingInfo> mappingBinding = new TypeBinding<MappingInfo>("MappingInfo") | ||
| .bind("channel", MappingInfo::getChannel) | ||
| .bind("stable", MappingInfo::isStable) | ||
| .bind("version", cmd -> cmd.getDownloader().getMappingsVersion(cmd.getMcVersion(), cmd.isStable()).block()) |
Owner
There was a problem hiding this comment.
Calling into the downloader is not a good idea, if this triggers a web request it will fail within trick context.
Contributor
Author
There was a problem hiding this comment.
How will it fail? I specifically tried to query stuff I did not have downloaded and it seemed to work fine
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.
This is a simple PR that adds a new static method to
MappingDownloader, which takes in a channel string and outputs the latest version for that string. A function is also added to the sandbox init clojure file to support this. This is useful for a trick that I am making. I confirmed it to work in nREPL.