2019-11-21 04:03:13 +05:30
|
|
|
package mojangtextures
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/elyby/chrly/api/mojang"
|
|
|
|
)
|
|
|
|
|
|
|
|
var uuidToTextures = mojang.UuidToTextures
|
|
|
|
|
|
|
|
type MojangApiTexturesProvider struct {
|
2020-02-08 15:58:10 +05:30
|
|
|
Emitter
|
2019-11-21 04:03:13 +05:30
|
|
|
}
|
|
|
|
|
|
|
|
func (ctx *MojangApiTexturesProvider) GetTextures(uuid string) (*mojang.SignedTexturesResponse, error) {
|
2020-02-08 15:58:10 +05:30
|
|
|
ctx.Emit("mojang_textures:mojang_api_textures_provider:before_request", uuid)
|
2019-11-21 04:03:13 +05:30
|
|
|
result, err := uuidToTextures(uuid, true)
|
2020-05-01 01:46:22 +05:30
|
|
|
ctx.Emit("mojang_textures:mojang_api_textures_provider:after_request", uuid, result, err)
|
2019-11-21 04:03:13 +05:30
|
|
|
|
|
|
|
return result, err
|
|
|
|
}
|