chore(crafter): Get #smithed.crafter:all from misode/mcmeta#37
Merged
rx-dev merged 2 commits intoSmithed-MC:mainfrom Nov 2, 2023
Merged
chore(crafter): Get #smithed.crafter:all from misode/mcmeta#37rx-dev merged 2 commits intoSmithed-MC:mainfrom
rx-dev merged 2 commits intoSmithed-MC:mainfrom
Conversation
Collaborator
|
This is a clean idea, thanks for writing this up. I'll want to use the |
Contributor
Author
|
Because the information is in the registries and not in the |
Collaborator
|
Ah, this makes sense then. I think this will be a good solution. |
vberlier
reviewed
Nov 2, 2023
There was a problem hiding this comment.
I'd suggest using beet's cache.download() method
def beet_default(ctx: Context):
cache = ctx.cache["smithed_crafter"]
all_items_url = f"https://raw.githubusercontent.com/misode/mcmeta/{ctx.minecraft_version}-registries/item/data.json"
all_items = ItemTag(source_path=cache.download(all_items_url))
all_items.data = {"values": all_items.data}
ctx.generate("smithed.crafter:all", all_items)
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.
Get the item list from "https://raw.githubusercontent.com/misode/mcmeta/{version}-registries/item/data.json" (where version is the ctx.minecraft_version).