nbt

package
v0.0.0-...-d3751e6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 13, 2024 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ListLimit       = 2097152
	ByteArrayLimit  = 16777216
	Int32ArrayLimit = ByteArrayLimit
	Int64ArrayLimit = ByteArrayLimit
	DepthLimit      = 512
)

Variables

View Source
var ErrorUnexpectedType error = errors.New("Unexpected type")

Functions

func WriteNbt

func WriteNbt(writer io.Writer, nbt Nbt) (err error)

func WriteNbtNamed

func WriteNbtNamed(writer io.Writer, nbt Nbt, name string) (err error)

Types

type ErrorLimit

type ErrorLimit struct {
	Subject string
	Length  int
	Limit   int
}

func (ErrorLimit) Error

func (this ErrorLimit) Error() string

type ErrorUnexpectedNbtTag

type ErrorUnexpectedNbtTag NbtTag

func (ErrorUnexpectedNbtTag) Error

func (this ErrorUnexpectedNbtTag) Error() string

type Nbt

type Nbt map[string]interface{}

func ReadNbt

func ReadNbt(reader io.Reader) (nbt Nbt, err error)

func ReadNbtNamed

func ReadNbtNamed(reader io.Reader) (nbt Nbt, name string, err error)

func (Nbt) Bool

func (this Nbt) Bool(name string) (ret bool, ok bool)

func (Nbt) ByteArray

func (this Nbt) ByteArray(name string) (ret []byte, ok bool)

func (Nbt) Float32

func (this Nbt) Float32(name string) (ret float32, ok bool)

func (Nbt) Float64

func (this Nbt) Float64(name string) (ret float64, ok bool)

func (Nbt) Int16

func (this Nbt) Int16(name string) (ret int16, ok bool)

func (Nbt) Int32

func (this Nbt) Int32(name string) (ret int32, ok bool)

func (Nbt) Int32Array

func (this Nbt) Int32Array(name string) (ret []int32, ok bool)

func (Nbt) Int64

func (this Nbt) Int64(name string) (ret int64, ok bool)

func (Nbt) Int64Array

func (this Nbt) Int64Array(name string) (ret []int64, ok bool)

func (Nbt) Int8

func (this Nbt) Int8(name string) (ret int8, ok bool)

func (Nbt) List

func (this Nbt) List(name string) (ret NbtList, ok bool)

func (Nbt) Nbt

func (this Nbt) Nbt(name string) (ret Nbt, ok bool)

func (Nbt) String

func (this Nbt) String(name string) (ret string, ok bool)

type NbtList

type NbtList struct {
	// contains filtered or unexported fields
}

func WrappedNbtList

func WrappedNbtList(array interface{}) NbtList

func (NbtList) AsByteArray

func (this NbtList) AsByteArray() [][]byte

func (NbtList) AsFloat32

func (this NbtList) AsFloat32() []int32

func (NbtList) AsFloat64

func (this NbtList) AsFloat64() []int64

func (NbtList) AsInt16

func (this NbtList) AsInt16() []int16

func (NbtList) AsInt32

func (this NbtList) AsInt32() []int32

func (NbtList) AsInt32Array

func (this NbtList) AsInt32Array() [][]int32

func (NbtList) AsInt64

func (this NbtList) AsInt64() []int64

func (NbtList) AsInt64Array

func (this NbtList) AsInt64Array() [][]int64

func (NbtList) AsInt8

func (this NbtList) AsInt8() []int8

func (NbtList) AsList

func (this NbtList) AsList() []NbtList

func (NbtList) AsNbt

func (this NbtList) AsNbt() []Nbt

func (NbtList) AsString

func (this NbtList) AsString() []string

func (NbtList) Nil

func (this NbtList) Nil() bool

type NbtTag

type NbtTag byte
const (
	NbtTagEnd NbtTag = iota
	NbtTagInt8
	NbtTagInt16
	NbtTagInt32
	NbtTagInt64
	NbtTagFloat32
	NbtTagFloat64
	NbtTagByteArray
	NbtTagString
	NbtTagList
	NbtTagNbt
	NbtTagInt32Array
	NbtTagInt64Array
)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL