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 CreateShared(name string) (*os.File, error)
- func DrawImgScaledPos(dst *image.RGBA, src *image.RGBA, bottomLeft image.Point, sizeScaled int)
- func DumpStruct(f io.StringWriter, inputStruct any)
- func FormatPackName(packName string) string
- func GetLocalIP() (string, error)
- func Img2rgba(img *image.RGBA) []color.RGBA
- func IsDebug() bool
- func LERP(p1, p2, alpha float64) float64
- func LookupColor(name string) color.RGBA
- func MakeValidFilename(name string) string
- func NewCfb8(r io.Reader, key []byte) io.Reader
- func OpenShared(name string) (*os.File, error)
- func ParseJson(s []byte, out any) error
- func PathCache(p ...string) string
- func PathData(p ...string) string
- 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 StripAnsi(str string) string
- func StripAnsiBytes(str []byte) []byte
- func UserInput(ctx context.Context, q string, validator func(string) bool) (string, bool)
- func WriteManifest(manifest *resource.Manifest, fs WriterFS, fpath string) error
- func ZipCompressPool(zw *zip.Writer)
- type BlockRID
- type ChunkRenderer
- type CountingWriter
- type MultiWriterFS
- type OSWriter
- type TexMapEntry
- type TexMapHash
- type TexMapIdx
- type TextureMap
- type WriterFS
- type ZipWriter
Constants ¶
This section is empty.
Variables ¶
View Source
var CmdName = "invalid"
View Source
var ErrorHandler = func(err error) { logrus.Fatal(err) }
View Source
var LogOff bool
View Source
var Version 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 FormatPackName ¶ added in v1.42.0
func GetLocalIP ¶
func LookupColor ¶ added in v1.31.1
func MakeValidFilename ¶ added in v1.45.1
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 StripAnsiBytes ¶ added in v1.45.1
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 CountingWriter ¶ added in v1.45.1
type CountingWriter struct {
// contains filtered or unexported fields
}
func NewCountingWriter ¶ added in v1.45.1
func NewCountingWriter(w io.Writer) *CountingWriter
func (*CountingWriter) BytesWritten ¶ added in v1.45.1
func (w *CountingWriter) BytesWritten() int64
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 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.