Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Download resource packs from a URL, rename Compile methods #202

Merged
merged 2 commits into from
Sep 21, 2023

Conversation

TwistedAsylumMC
Copy link
Collaborator

Resource packs with a download URL will now send the URL in the ResourcePacksInfo packet.

A few breaking API changes have been made to the minecraft/resource package:

- resource.FromBytes([]byte) (*resource.Pack, error)
+ resource.Read(io.Reader) (*resource.Pack, error)

- resource.Compile(string) (*resource.Pack, error)
+ resource.ReadPath(string) (*resource.Pack, error)

- resource.MustCompile(string) *resource.Pack
+ resource.MustReadPath(string) *resource.Pack

+ resource.ReadURL(string) (*resource.Pack, error)
+ resource.MustReadURL(string) *resource.Pack

Two new functions have been added to the resource.Pack struct:

+ DownloadURL() string
+ WithDownloadURL(string) *resource.Pack

Copy link
Owner

@Sandertv Sandertv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good mostly! Does this work with the specific folders etc that these URL packs have to be in?

minecraft/resource/pack.go Outdated Show resolved Hide resolved
minecraft/resource/pack.go Outdated Show resolved Hide resolved
@TwistedAsylumMC TwistedAsylumMC merged commit 62b14e8 into master Sep 21, 2023
1 check passed
@TwistedAsylumMC TwistedAsylumMC deleted the feature/packurls branch January 5, 2024 11:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants