Documentation ¶
Overview ¶
Package utils ...
Index ¶
- Variables
- func BlendColors(c1, c2 color.RGBA) (ret color.RGBA)
- func CfbDecrypt(data []byte, key []byte) []byte
- func CleanupName(name string) string
- func CopyFS(src fs.FS, dst WriterFS) error
- func DrawImgScaledPos(dst *image.RGBA, src *image.RGBA, bottomLeft image.Point, sizeScaled int)
- func DumpStruct(f io.StringWriter, inputStruct any)
- func Img2rgba(img *image.RGBA) []color.RGBA
- func LERP(p1, p2, alpha float64) float64
- func LookupColor(name string) color.RGBA
- func Netisolation() error
- func NewCfb8(r io.Reader, key []byte) io.Reader
- func OpenUrl(uri string) error
- func ParseJson(s []byte, out any) error
- func PrintPanic(err error)
- func RGBA2Img(colors []color.RGBA, width, height int) *image.RGBA
- func RandSeededUUID(str string) string
- func RecoverCall(f func() error) (err error)
- func RemoveDir(name string) error
- func RemoveFile(name string) error
- func RemoveTree(dir string) error
- func ResolveColors(entries []protocol.BlockEntry, packs []resource.Pack) map[string]color.RGBA
- func ShowFile(path string)
- func SizeofFmt(num float32) string
- func SplitExt(filename string) (name, ext string)
- func StackToItem(reg world.BlockRegistry, 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 ValidateServerInput(server string) bool
- func WriteManifest(manifest *resource.Manifest, fs WriterFS, fpath string) error
- func ZipCompressPool(zw *zip.Writer)
- type BlockRID
- type ChunkRenderer
- type ConnectInfo
- type MultiWriterFS
- type OSWriter
- type Skin
- type SkinGeometry
- type SkinGeometryDescription
- type SkinGeometryFile
- type SkinGeometry_Old
- type SkinMeta
- type SkinPack
- type TexMapEntry
- type TexMapHash
- type TexMapIdx
- type TextureMap
- type WriterFS
- type ZipWriter
Constants ¶
This section is empty.
Variables ¶
View Source
var Auth *authsrv = &authsrv{ log: logrus.WithField("part", "Auth"), }
View Source
var ConnectInfoKey key
View Source
var ErrNotLoggedIn = errors.New("not logged in")
View Source
var ErrorHandler = func(err error) { logrus.Fatal(err) }
View Source
var LogOff bool
View Source
var Options struct { Debug bool IsInteractive bool ExtraDebug bool Capture bool Env string }
View Source
var Tokene = func(w io.Writer, o any) error { return json.NewEncoder(w).Encode(o) }
View Source
var Ver1token func(f io.ReadSeeker, o any) error
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 LookupColor ¶ added in v1.31.1
func Netisolation ¶ added in v1.39.1
func Netisolation() error
func PrintPanic ¶ added in v1.31.1
func PrintPanic(err error)
func RandSeededUUID ¶ added in v1.28.0
func RecoverCall ¶ added in v1.41.0
func RemoveFile ¶ added in v1.39.0
func RemoveTree ¶ added in v1.39.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 ValidateServerInput ¶ added in v1.30.0
func WriteManifest ¶ added in v1.28.0
func ZipCompressPool ¶ added in v1.39.1
Types ¶
type ChunkRenderer ¶ added in v1.39.0
type ChunkRenderer struct {
// contains filtered or unexported fields
}
func (*ChunkRenderer) Chunk2Img ¶ added in v1.39.0
func (cr *ChunkRenderer) Chunk2Img(c *chunk.Chunk) *image.RGBA
func (*ChunkRenderer) ResolveColors ¶ added in v1.39.0
func (cr *ChunkRenderer) ResolveColors(entries []protocol.BlockEntry, packs []resource.Pack)
type ConnectInfo ¶ added in v1.39.1
type ConnectInfo struct { Gathering *gatherings.Gathering Realm *realms.Realm Replay string ServerAddress string }
func ParseServer ¶ added in v1.33.0
func ParseServer(ctx context.Context, server string) (*ConnectInfo, error)
func (*ConnectInfo) Address ¶ added in v1.39.1
func (c *ConnectInfo) Address(ctx context.Context) (string, error)
func (*ConnectInfo) Name ¶ added in v1.39.1
func (c *ConnectInfo) Name() string
type MultiWriterFS ¶ added in v1.39.0
type MultiWriterFS struct {
FSs []WriterFS
}
func (MultiWriterFS) Create ¶ added in v1.39.0
func (m MultiWriterFS) Create(filename string) (w io.WriteCloser, err error)
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 { Description SkinGeometryDescription `json:"description"` Bones json.RawMessage `json:"bones"` }
type SkinGeometryDescription ¶ added in v1.31.0
type SkinGeometryDescription struct { Identifier string `json:"identifier"` TextureWidth json.Number `json:"texture_width"` TextureHeight json.Number `json:"texture_height"` VisibleBoundsWidth float64 `json:"visible_bounds_width"` VisibleBoundsHeight float64 `json:"visible_bounds_height"` VisibleBoundsOffset []float64 `json:"visible_bounds_offset,omitempty"` }
type SkinGeometryFile ¶ added in v1.40.0
type SkinGeometryFile struct { FormatVersion string `json:"format_version"` Geometry []SkinGeometry `json:"minecraft:geometry"` }
func ParseSkinGeometry ¶ added in v1.37.0
func ParseSkinGeometry(skin *protocol.Skin) (*SkinGeometryFile, string, error)
type SkinGeometry_Old ¶ added in v1.37.0
type SkinGeometry_Old struct { SkinGeometryDescription Bones json.RawMessage `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.