Sandertv / gophertunnel

General purpose library for Minecraft Bedrock Edition software written in Go
MIT License
423 stars 96 forks source link

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

Closed TwistedAsylumMC closed 1 year ago

TwistedAsylumMC commented 1 year ago

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