Documentation ¶
Overview ¶
Package utils ...
Index ¶
- Constants
- Variables
- func BlendColors(c1, c2 color.RGBA64) (ret color.RGBA64)
- func CfbDecrypt(data []byte, key []byte) []byte
- func Chunk2Img(c *chunk.Chunk) *image.RGBA64
- func CleanupName(name string) string
- func DrawImgScaledPos(dst *image.RGBA, src *image.RGBA, bottomLeft image.Point, sizeScaled int)
- func DumpStruct(f io.StringWriter, inputStruct any)
- func GetLocalIP() string
- func GetRealmsAPI() *realms.Client
- func IPPrivate(ip net.IP) bool
- func Img2rgba(img *image.RGBA) []color.RGBA
- func LERP(p1, p2, alpha float64) float64
- func LookupColor(name string) color.RGBA
- func NewCfb8(r io.Reader, key []byte) io.Reader
- func ParseJson(s []byte, out any) error
- func ParseServer(ctx context.Context, server string) (address, name string, err error)
- func PrintPanic(err error)
- func RGBAToRGBA64(rgba color.RGBA) color.RGBA64
- func RandSeededUUID(str string) string
- func ResolveColors(entries []protocol.BlockEntry, packs []Pack, addToBlocks bool) (*image.RGBA, map[string]color.RGBA64)
- func ServerInput(ctx context.Context, server string) (string, string, error)
- func ShowFile(path string)
- func SizeofFmt(num float32) string
- func SplitExt(filename string) (name, ext string)
- func StackToItem(it protocol.ItemStack) item.Stack
- func UploadError(err error)
- func UploadPanic()
- func UserInput(ctx context.Context, q string, validator func(string) bool) (string, bool)
- func WriteManifest(manifest *resource.Manifest, fpath string) error
- func ZipFolder(filename, folder string) error
- type BlockRID
- type DeflatePool
- type Pack
- type Skin
- type SkinGeometry
- type SkinGeometryDescription
- type SkinGeometry_1_12
- type SkinMeta
- type SkinPack
- type TexMapEntry
- type TexMapHash
- type TexMapIdx
- type TextureMap
Constants ¶
View Source
const TokenFile = "token.json"
Variables ¶
View Source
var Auth authsrv
View Source
var Options struct { Debug bool IsInteractive bool ExtraDebug bool Capture bool PathCustomUserData string }
View Source
var PackFromBase = func(pack *resource.Pack) Pack { b := &packBase{pack, false} return b }
View Source
var RealmsEnv string
Functions ¶
func CfbDecrypt ¶ added in v1.28.0
func CleanupName ¶
CleanupName cleans name so it can be used as a filename
func DrawImgScaledPos ¶ added in v1.28.0
DrawImgScaledPos draws src onto dst at bottomLeft, scaled to size
func DumpStruct ¶ added in v1.28.0
func DumpStruct(f io.StringWriter, inputStruct any)
func GetRealmsAPI ¶ added in v1.28.0
func LookupColor ¶ added in v1.31.1
func ParseServer ¶ added in v1.33.0
func PrintPanic ¶ added in v1.31.1
func PrintPanic(err error)
func RandSeededUUID ¶ added in v1.28.0
func ResolveColors ¶ added in v1.31.1
func StackToItem ¶ added in v1.32.0
stackToItem converts a network ItemStack representation back to an item.Stack.
func UploadError ¶ added in v1.31.1
func UploadError(err error)
func UploadPanic ¶ added in v1.31.1
func UploadPanic()
func WriteManifest ¶ added in v1.28.0
Types ¶
type DeflatePool ¶ added in v1.31.1
type DeflatePool struct {
// contains filtered or unexported fields
}
func (*DeflatePool) GetWriter ¶ added in v1.31.1
func (pool *DeflatePool) GetWriter(dst io.Writer) (writer *flate.Writer)
func (*DeflatePool) ReturnWriter ¶ added in v1.31.1
func (pool *DeflatePool) ReturnWriter(writer *flate.Writer)
type Pack ¶ added in v1.28.0
type Skin ¶ added in v1.28.1
func (*Skin) HaveAnimations ¶ added in v1.28.1
func (*Skin) HaveGeometry ¶ added in v1.28.1
func (*Skin) WriteCapePng ¶ added in v1.28.1
WriteCape writes the cape as a png at output_path
type SkinGeometry ¶ added in v1.28.1
type SkinGeometry struct { SkinGeometryDescription Bones []any `json:"bones"` }
type SkinGeometryDescription ¶ added in v1.31.0
type SkinGeometryDescription struct { Identifier string `json:"identifier,omitempty"` Texturewidth int `json:"texturewidth"` Textureheight int `json:"textureheight"` VisibleBoundsWidth float64 `json:"visible_bounds_width"` VisibleBoundsHeight float64 `json:"visible_bounds_height"` VisibleBoundsOffset []float64 `json:"visible_bounds_offset,omitempty"` }
type SkinGeometry_1_12 ¶ added in v1.31.0
type SkinGeometry_1_12 struct { Description SkinGeometryDescription `json:"description"` Bones []any `json:"bones"` }
type SkinPack ¶ added in v1.28.1
type SkinPack struct { Name string // contains filtered or unexported fields }
func NewSkinPack ¶ added in v1.28.1
type TexMapEntry ¶ added in v1.32.0
type TexMapHash ¶ added in v1.32.0
type TexMapHash = uint64
type TextureMap ¶ added in v1.32.0
func NewTextureMap ¶ added in v1.32.0
func NewTextureMap() *TextureMap
func (*TextureMap) SetTextures ¶ added in v1.32.0
func (t *TextureMap) SetTextures(blocks []world.Block, resolvedTextures map[string]image.Image) map[BlockRID]TexMapEntry
Source Files ¶
Click to show internal directories.
Click to hide internal directories.