Documentation
¶
Overview ¶
Package nbt implements a full Named Binary Tag reader/writer, based on the specs at http://web.archive.org/web/20110723210920/http://www.minecraft.net/docs/NBT.txt
Index ¶
- Variables
- func Encode(w io.Writer, t Tag) error
- type Bool
- type Byte
- type ByteArray
- type Complex128
- type Complex64
- type Compound
- type Data
- type Decoder
- type Double
- type Encoder
- type Float
- type Int
- type IntArray
- type List
- type ListBool
- func (l *ListBool) Append(d ...Data) error
- func (l ListBool) Copy() Data
- func (l ListBool) Equal(e interface{}) bool
- func (l ListBool) Get(i int) Data
- func (l *ListBool) Insert(i int, d ...Data) error
- func (l ListBool) Len() int
- func (l *ListBool) Remove(i int)
- func (l ListBool) Set(i int, d Data) error
- func (l ListBool) String() string
- func (ListBool) TagType() TagID
- func (ListBool) Type() TagID
- type ListByte
- func (l *ListByte) Append(d ...Data) error
- func (l ListByte) Copy() Data
- func (l ListByte) Equal(e interface{}) bool
- func (l ListByte) Get(i int) Data
- func (l *ListByte) Insert(i int, d ...Data) error
- func (l ListByte) Len() int
- func (l *ListByte) Remove(i int)
- func (l ListByte) Set(i int, d Data) error
- func (l ListByte) String() string
- func (ListByte) TagType() TagID
- func (ListByte) Type() TagID
- type ListComplex128
- func (l *ListComplex128) Append(d ...Data) error
- func (l ListComplex128) Copy() Data
- func (l ListComplex128) Equal(e interface{}) bool
- func (l ListComplex128) Get(i int) Data
- func (l *ListComplex128) Insert(i int, d ...Data) error
- func (l ListComplex128) Len() int
- func (l *ListComplex128) Remove(i int)
- func (l ListComplex128) Set(i int, d Data) error
- func (l ListComplex128) String() string
- func (ListComplex128) TagType() TagID
- func (ListComplex128) Type() TagID
- type ListComplex64
- func (l *ListComplex64) Append(d ...Data) error
- func (l ListComplex64) Copy() Data
- func (l ListComplex64) Equal(e interface{}) bool
- func (l ListComplex64) Get(i int) Data
- func (l *ListComplex64) Insert(i int, d ...Data) error
- func (l ListComplex64) Len() int
- func (l *ListComplex64) Remove(i int)
- func (l ListComplex64) Set(i int, d Data) error
- func (l ListComplex64) String() string
- func (ListComplex64) TagType() TagID
- func (ListComplex64) Type() TagID
- type ListCompound
- func (l *ListCompound) Append(d ...Data) error
- func (l ListCompound) Copy() Data
- func (l ListCompound) Equal(e interface{}) bool
- func (l ListCompound) Get(i int) Data
- func (l *ListCompound) Insert(i int, d ...Data) error
- func (l ListCompound) Len() int
- func (l *ListCompound) Remove(i int)
- func (l ListCompound) Set(i int, d Data) error
- func (l ListCompound) String() string
- func (ListCompound) TagType() TagID
- func (ListCompound) Type() TagID
- type ListData
- func (l *ListData) Append(data ...Data) error
- func (l *ListData) Copy() Data
- func (l *ListData) Equal(e interface{}) bool
- func (l *ListData) Get(i int) Data
- func (l *ListData) Insert(i int, data ...Data) error
- func (l *ListData) Len() int
- func (l ListData) ListBool() ListBool
- func (l ListData) ListByte() ListByte
- func (l ListData) ListComplex128() ListComplex128
- func (l ListData) ListComplex64() ListComplex64
- func (l ListData) ListCompound() ListCompound
- func (l ListData) ListDouble() ListDouble
- func (l ListData) ListEnd() ListEnd
- func (l ListData) ListFloat() ListFloat
- func (l ListData) ListInt() ListInt
- func (l ListData) ListIntArray() ListIntArray
- func (l ListData) ListLong() ListLong
- func (l ListData) ListShort() ListShort
- func (l ListData) ListUint16() ListUint16
- func (l ListData) ListUint32() ListUint32
- func (l ListData) ListUint64() ListUint64
- func (l ListData) ListUint8() ListUint8
- func (l *ListData) Remove(i int)
- func (l *ListData) Set(i int, data Data) error
- func (l *ListData) String() string
- func (l *ListData) TagType() TagID
- func (ListData) Type() TagID
- type ListDouble
- func (l *ListDouble) Append(d ...Data) error
- func (l ListDouble) Copy() Data
- func (l ListDouble) Equal(e interface{}) bool
- func (l ListDouble) Get(i int) Data
- func (l *ListDouble) Insert(i int, d ...Data) error
- func (l ListDouble) Len() int
- func (l *ListDouble) Remove(i int)
- func (l ListDouble) Set(i int, d Data) error
- func (l ListDouble) String() string
- func (ListDouble) TagType() TagID
- func (ListDouble) Type() TagID
- type ListEnd
- func (l *ListEnd) Append(d ...Data) error
- func (l ListEnd) Copy() Data
- func (l ListEnd) Equal(e interface{}) bool
- func (ListEnd) Get(_ int) Data
- func (l *ListEnd) Insert(_ int, d ...Data) error
- func (l ListEnd) Len() int
- func (l *ListEnd) Remove(i int)
- func (l ListEnd) Set(_ int, d Data) error
- func (l ListEnd) String() string
- func (ListEnd) TagType() TagID
- func (ListEnd) Type() TagID
- type ListFloat
- func (l *ListFloat) Append(d ...Data) error
- func (l ListFloat) Copy() Data
- func (l ListFloat) Equal(e interface{}) bool
- func (l ListFloat) Get(i int) Data
- func (l *ListFloat) Insert(i int, d ...Data) error
- func (l ListFloat) Len() int
- func (l *ListFloat) Remove(i int)
- func (l ListFloat) Set(i int, d Data) error
- func (l ListFloat) String() string
- func (ListFloat) TagType() TagID
- func (ListFloat) Type() TagID
- type ListInt
- func (l *ListInt) Append(d ...Data) error
- func (l ListInt) Copy() Data
- func (l ListInt) Equal(e interface{}) bool
- func (l ListInt) Get(i int) Data
- func (l *ListInt) Insert(i int, d ...Data) error
- func (l ListInt) Len() int
- func (l *ListInt) Remove(i int)
- func (l ListInt) Set(i int, d Data) error
- func (l ListInt) String() string
- func (ListInt) TagType() TagID
- func (ListInt) Type() TagID
- type ListIntArray
- func (l *ListIntArray) Append(d ...Data) error
- func (l ListIntArray) Copy() Data
- func (l ListIntArray) Equal(e interface{}) bool
- func (l ListIntArray) Get(i int) Data
- func (l *ListIntArray) Insert(i int, d ...Data) error
- func (l ListIntArray) Len() int
- func (l *ListIntArray) Remove(i int)
- func (l ListIntArray) Set(i int, d Data) error
- func (l ListIntArray) String() string
- func (ListIntArray) TagType() TagID
- func (ListIntArray) Type() TagID
- type ListLong
- func (l *ListLong) Append(d ...Data) error
- func (l ListLong) Copy() Data
- func (l ListLong) Equal(e interface{}) bool
- func (l ListLong) Get(i int) Data
- func (l *ListLong) Insert(i int, d ...Data) error
- func (l ListLong) Len() int
- func (l *ListLong) Remove(i int)
- func (l ListLong) Set(i int, d Data) error
- func (l ListLong) String() string
- func (ListLong) TagType() TagID
- func (ListLong) Type() TagID
- type ListShort
- func (l *ListShort) Append(d ...Data) error
- func (l ListShort) Copy() Data
- func (l ListShort) Equal(e interface{}) bool
- func (l ListShort) Get(i int) Data
- func (l *ListShort) Insert(i int, d ...Data) error
- func (l ListShort) Len() int
- func (l *ListShort) Remove(i int)
- func (l ListShort) Set(i int, d Data) error
- func (l ListShort) String() string
- func (ListShort) TagType() TagID
- func (ListShort) Type() TagID
- type ListUint16
- func (l *ListUint16) Append(d ...Data) error
- func (l ListUint16) Copy() Data
- func (l ListUint16) Equal(e interface{}) bool
- func (l ListUint16) Get(i int) Data
- func (l *ListUint16) Insert(i int, d ...Data) error
- func (l ListUint16) Len() int
- func (l *ListUint16) Remove(i int)
- func (l ListUint16) Set(i int, d Data) error
- func (l ListUint16) String() string
- func (ListUint16) TagType() TagID
- func (ListUint16) Type() TagID
- type ListUint32
- func (l *ListUint32) Append(d ...Data) error
- func (l ListUint32) Copy() Data
- func (l ListUint32) Equal(e interface{}) bool
- func (l ListUint32) Get(i int) Data
- func (l *ListUint32) Insert(i int, d ...Data) error
- func (l ListUint32) Len() int
- func (l *ListUint32) Remove(i int)
- func (l ListUint32) Set(i int, d Data) error
- func (l ListUint32) String() string
- func (ListUint32) TagType() TagID
- func (ListUint32) Type() TagID
- type ListUint64
- func (l *ListUint64) Append(d ...Data) error
- func (l ListUint64) Copy() Data
- func (l ListUint64) Equal(e interface{}) bool
- func (l ListUint64) Get(i int) Data
- func (l *ListUint64) Insert(i int, d ...Data) error
- func (l ListUint64) Len() int
- func (l *ListUint64) Remove(i int)
- func (l ListUint64) Set(i int, d Data) error
- func (l ListUint64) String() string
- func (ListUint64) TagType() TagID
- func (ListUint64) Type() TagID
- type ListUint8
- func (l *ListUint8) Append(d ...Data) error
- func (l ListUint8) Copy() Data
- func (l ListUint8) Equal(e interface{}) bool
- func (l ListUint8) Get(i int) Data
- func (l *ListUint8) Insert(i int, d ...Data) error
- func (l ListUint8) Len() int
- func (l *ListUint8) Remove(i int)
- func (l ListUint8) Set(i int, d Data) error
- func (l ListUint8) String() string
- func (ListUint8) TagType() TagID
- func (ListUint8) Type() TagID
- type Long
- type ReadError
- type Short
- type String
- type Tag
- type TagID
- type Uint16
- type Uint32
- type Uint64
- type Uint8
- type UnknownTag
- type WriteError
- type WrongTag
Constants ¶
This section is empty.
Variables ¶
var ErrBadRange = errors.New("given index was out-of-range")
ErrBadRange is an error that occurs when trying to set an item on a list which is outside of the current limits of the list.
Functions ¶
Types ¶
type Bool ¶
type Bool bool
Bool is an implementation of the Data interface.
type Byte ¶
type Byte int8
Byte is an implementation of the Data interface NB: Despite being an unsigned integer, it is still called a byte to match the spec.
type ByteArray ¶
type ByteArray []int8
ByteArray is an implementation of the Data interface.
func (ByteArray) Bytes ¶
Bytes converts the ByteArray (actually int8) to an actual slice of bytes. NB: May uss unsafe, so the underlying array may be the same.
type Complex128 ¶
type Complex128 complex128
Complex128 is an implementation of the Data interface.
func (Complex128) Equal ¶
func (c Complex128) Equal(e interface{}) bool
Equal satisfies the equaler.Equaler interface, allowing for types to be checked for equality.
func (Complex128) String ¶
func (c Complex128) String() string
type Complex64 ¶
type Complex64 complex64
Complex64 is an implementation of the Data interface.
type Compound ¶
type Compound []Tag
Compound is an implementation of the Data interface.
func (Compound) Equal ¶
Equal satisfies the equaler.Equaler interface, allowing for types to be checked for equality.
type Decoder ¶
type Decoder struct {
// contains filtered or unexported fields
}
Decoder is a type used to decode NBT streams.
func NewDecoder ¶
NewDecoder returns a Decoder using Big Endian.
func NewDecoderEndian ¶
func NewDecoderEndian(e byteio.EndianReader) Decoder
NewDecoderEndian allows you to specify your own Endian Reader.
type Double ¶
type Double float64
Double is an implementation of the Data interface.
type Encoder ¶
type Encoder struct {
// contains filtered or unexported fields
}
Encoder is a type used to encode NBT streams
func NewEncoder ¶
NewEncoder returns an Encoder using Big Endian
func NewEncoderEndian ¶
func NewEncoderEndian(e byteio.EndianWriter) Encoder
NewEncoderEndian allows you to specify your own Endian Writer
type Float ¶
type Float float32
Float is an implementation of the Data interface.
type Int ¶
type Int int32
Int is an implementation of the Data interface.
type IntArray ¶
type IntArray []int32
IntArray is an implementation of the Data interface.
type List ¶
type List interface { Data Set(int, Data) error Get(int) Data Append(...Data) error Insert(int, ...Data) error Remove(int) Len() int TagType() TagID }
List interface descibes the methods for the lists of different data types.
func NewEmptyList ¶
NewEmptyList returns a new empty List Data type, set to the type given.
type ListBool ¶
type ListBool []Bool
ListBool satisfies the List interface for a list of Bools.
func (ListBool) Equal ¶
Equal satisfies the equaler.Equaler interface, allowing for types to be checked for equality
func (*ListBool) Insert ¶
Insert will add the given data at the specified position, moving other up.
type ListByte ¶
type ListByte []Byte
ListByte satisfies the List interface for a list of Bytes.
func (ListByte) Equal ¶
Equal satisfies the equaler.Equaler interface, allowing for types to be checked for equality
func (*ListByte) Insert ¶
Insert will add the given data at the specified position, moving other up.
type ListComplex128 ¶
type ListComplex128 []Complex128
ListComplex128 satisfies the List interface for a list of Complex128s.
func (*ListComplex128) Append ¶
func (l *ListComplex128) Append(d ...Data) error
Append adds data to the list
func (ListComplex128) Copy ¶
func (l ListComplex128) Copy() Data
Copy simply returns a deep-copy of the data.
func (ListComplex128) Equal ¶
func (l ListComplex128) Equal(e interface{}) bool
Equal satisfies the equaler.Equaler interface, allowing for types to be checked for equality
func (ListComplex128) Get ¶
func (l ListComplex128) Get(i int) Data
Get returns the data at the given position.
func (*ListComplex128) Insert ¶
func (l *ListComplex128) Insert(i int, d ...Data) error
Insert will add the given data at the specified position, moving other up.
func (*ListComplex128) Remove ¶
func (l *ListComplex128) Remove(i int)
Remove deletes the specified position and shifts remaining data down.
func (ListComplex128) Set ¶
func (l ListComplex128) Set(i int, d Data) error
Set sets the data at the given position. It does not append.
func (ListComplex128) String ¶
func (l ListComplex128) String() string
func (ListComplex128) TagType ¶
func (ListComplex128) TagType() TagID
TagType returns the TagID of the type of tag this list contains.
type ListComplex64 ¶
type ListComplex64 []Complex64
ListComplex64 satisfies the List interface for a list of Complex64s.
func (*ListComplex64) Append ¶
func (l *ListComplex64) Append(d ...Data) error
Append adds data to the list
func (ListComplex64) Copy ¶
func (l ListComplex64) Copy() Data
Copy simply returns a deep-copy of the data.
func (ListComplex64) Equal ¶
func (l ListComplex64) Equal(e interface{}) bool
Equal satisfies the equaler.Equaler interface, allowing for types to be checked for equality
func (ListComplex64) Get ¶
func (l ListComplex64) Get(i int) Data
Get returns the data at the given position.
func (*ListComplex64) Insert ¶
func (l *ListComplex64) Insert(i int, d ...Data) error
Insert will add the given data at the specified position, moving other up.
func (*ListComplex64) Remove ¶
func (l *ListComplex64) Remove(i int)
Remove deletes the specified position and shifts remaining data down.
func (ListComplex64) Set ¶
func (l ListComplex64) Set(i int, d Data) error
Set sets the data at the given position. It does not append.
func (ListComplex64) String ¶
func (l ListComplex64) String() string
func (ListComplex64) TagType ¶
func (ListComplex64) TagType() TagID
TagType returns the TagID of the type of tag this list contains.
type ListCompound ¶
type ListCompound []Compound
ListCompound satisfies the List interface for a list of Compounds.
func (*ListCompound) Append ¶
func (l *ListCompound) Append(d ...Data) error
Append adds data to the list
func (ListCompound) Copy ¶
func (l ListCompound) Copy() Data
Copy simply returns a deep-copy of the data.
func (ListCompound) Equal ¶
func (l ListCompound) Equal(e interface{}) bool
Equal satisfies the equaler.Equaler interface, allowing for types to be checked for equality
func (ListCompound) Get ¶
func (l ListCompound) Get(i int) Data
Get returns the data at the given position.
func (*ListCompound) Insert ¶
func (l *ListCompound) Insert(i int, d ...Data) error
Insert will add the given data at the specified position, moving other up.
func (*ListCompound) Remove ¶
func (l *ListCompound) Remove(i int)
Remove deletes the specified position and shifts remaining data down.
func (ListCompound) Set ¶
func (l ListCompound) Set(i int, d Data) error
Set sets the data at the given position. It does not append.
func (ListCompound) String ¶
func (l ListCompound) String() string
func (ListCompound) TagType ¶
func (ListCompound) TagType() TagID
TagType returns the TagID of the type of tag this list contains.
type ListData ¶
type ListData struct {
// contains filtered or unexported fields
}
ListData is an implementation of the Data interface.
func (*ListData) Equal ¶
Equal satisfies the equaler.Equaler interface, allowing for types to be checked for equality.
func (*ListData) Insert ¶
Insert will add the given data at the specified position, moving other elements up.
func (ListData) ListComplex128 ¶
func (l ListData) ListComplex128() ListComplex128
ListComplex128 returns the list as a specifically typed List.
func (ListData) ListComplex64 ¶
func (l ListData) ListComplex64() ListComplex64
ListComplex64 returns the list as a specifically typed List.
func (ListData) ListCompound ¶
func (l ListData) ListCompound() ListCompound
ListCompound returns the list as a specifically typed List.
func (ListData) ListDouble ¶
func (l ListData) ListDouble() ListDouble
ListDouble returns the list as a specifically typed List.
func (ListData) ListIntArray ¶
func (l ListData) ListIntArray() ListIntArray
ListIntArray returns the list as a specifically typed List.
func (ListData) ListUint16 ¶
func (l ListData) ListUint16() ListUint16
ListUint16 returns the list as a specifically typed List.
func (ListData) ListUint32 ¶
func (l ListData) ListUint32() ListUint32
ListUint32 returns the list as a specifically typed List.
func (ListData) ListUint64 ¶
func (l ListData) ListUint64() ListUint64
ListUint64 returns the list as a specifically typed List.
type ListDouble ¶
type ListDouble []Double
ListDouble satisfies the List interface for a list of Doubles.
func (*ListDouble) Append ¶
func (l *ListDouble) Append(d ...Data) error
Append adds data to the list
func (ListDouble) Copy ¶
func (l ListDouble) Copy() Data
Copy simply returns a deep-copy of the data.
func (ListDouble) Equal ¶
func (l ListDouble) Equal(e interface{}) bool
Equal satisfies the equaler.Equaler interface, allowing for types to be checked for equality
func (ListDouble) Get ¶
func (l ListDouble) Get(i int) Data
Get returns the data at the given position.
func (*ListDouble) Insert ¶
func (l *ListDouble) Insert(i int, d ...Data) error
Insert will add the given data at the specified position, moving other up.
func (*ListDouble) Remove ¶
func (l *ListDouble) Remove(i int)
Remove deletes the specified position and shifts remaining data down.
func (ListDouble) Set ¶
func (l ListDouble) Set(i int, d Data) error
Set sets the data at the given position. It does not append.
func (ListDouble) String ¶
func (l ListDouble) String() string
func (ListDouble) TagType ¶
func (ListDouble) TagType() TagID
TagType returns the TagID of the type of tag this list contains.
type ListEnd ¶
type ListEnd uint32
ListEnd satisfies the List interface for a list of Ends.
func (ListEnd) Equal ¶
Equal satisfies the equaler.Equaler interface, allowing for types to be checked for equality.
type ListFloat ¶
type ListFloat []Float
ListFloat satisfies the List interface for a list of Floats.
func (ListFloat) Equal ¶
Equal satisfies the equaler.Equaler interface, allowing for types to be checked for equality
func (*ListFloat) Insert ¶
Insert will add the given data at the specified position, moving other up.
type ListInt ¶
type ListInt []Int
ListInt satisfies the List interface for a list of Ints.
func (ListInt) Equal ¶
Equal satisfies the equaler.Equaler interface, allowing for types to be checked for equality
type ListIntArray ¶
type ListIntArray []IntArray
ListIntArray satisfies the List interface for a list of IntArrays.
func (*ListIntArray) Append ¶
func (l *ListIntArray) Append(d ...Data) error
Append adds data to the list
func (ListIntArray) Copy ¶
func (l ListIntArray) Copy() Data
Copy simply returns a deep-copy of the data.
func (ListIntArray) Equal ¶
func (l ListIntArray) Equal(e interface{}) bool
Equal satisfies the equaler.Equaler interface, allowing for types to be checked for equality
func (ListIntArray) Get ¶
func (l ListIntArray) Get(i int) Data
Get returns the data at the given position.
func (*ListIntArray) Insert ¶
func (l *ListIntArray) Insert(i int, d ...Data) error
Insert will add the given data at the specified position, moving other up.
func (*ListIntArray) Remove ¶
func (l *ListIntArray) Remove(i int)
Remove deletes the specified position and shifts remaining data down.
func (ListIntArray) Set ¶
func (l ListIntArray) Set(i int, d Data) error
Set sets the data at the given position. It does not append.
func (ListIntArray) String ¶
func (l ListIntArray) String() string
func (ListIntArray) TagType ¶
func (ListIntArray) TagType() TagID
TagType returns the TagID of the type of tag this list contains.
type ListLong ¶
type ListLong []Long
ListLong satisfies the List interface for a list of Longs.
func (ListLong) Equal ¶
Equal satisfies the equaler.Equaler interface, allowing for types to be checked for equality
func (*ListLong) Insert ¶
Insert will add the given data at the specified position, moving other up.
type ListShort ¶
type ListShort []Short
ListShort satisfies the List interface for a list of Shorts.
func (ListShort) Equal ¶
Equal satisfies the equaler.Equaler interface, allowing for types to be checked for equality
func (*ListShort) Insert ¶
Insert will add the given data at the specified position, moving other up.
type ListUint16 ¶
type ListUint16 []Uint16
ListUint16 satisfies the List interface for a list of Uint16s.
func (*ListUint16) Append ¶
func (l *ListUint16) Append(d ...Data) error
Append adds data to the list
func (ListUint16) Copy ¶
func (l ListUint16) Copy() Data
Copy simply returns a deep-copy of the data.
func (ListUint16) Equal ¶
func (l ListUint16) Equal(e interface{}) bool
Equal satisfies the equaler.Equaler interface, allowing for types to be checked for equality
func (ListUint16) Get ¶
func (l ListUint16) Get(i int) Data
Get returns the data at the given position.
func (*ListUint16) Insert ¶
func (l *ListUint16) Insert(i int, d ...Data) error
Insert will add the given data at the specified position, moving other up.
func (*ListUint16) Remove ¶
func (l *ListUint16) Remove(i int)
Remove deletes the specified position and shifts remaining data down.
func (ListUint16) Set ¶
func (l ListUint16) Set(i int, d Data) error
Set sets the data at the given position. It does not append.
func (ListUint16) String ¶
func (l ListUint16) String() string
func (ListUint16) TagType ¶
func (ListUint16) TagType() TagID
TagType returns the TagID of the type of tag this list contains.
type ListUint32 ¶
type ListUint32 []Uint32
ListUint32 satisfies the List interface for a list of Uint32s.
func (*ListUint32) Append ¶
func (l *ListUint32) Append(d ...Data) error
Append adds data to the list
func (ListUint32) Copy ¶
func (l ListUint32) Copy() Data
Copy simply returns a deep-copy of the data.
func (ListUint32) Equal ¶
func (l ListUint32) Equal(e interface{}) bool
Equal satisfies the equaler.Equaler interface, allowing for types to be checked for equality
func (ListUint32) Get ¶
func (l ListUint32) Get(i int) Data
Get returns the data at the given position.
func (*ListUint32) Insert ¶
func (l *ListUint32) Insert(i int, d ...Data) error
Insert will add the given data at the specified position, moving other up.
func (*ListUint32) Remove ¶
func (l *ListUint32) Remove(i int)
Remove deletes the specified position and shifts remaining data down.
func (ListUint32) Set ¶
func (l ListUint32) Set(i int, d Data) error
Set sets the data at the given position. It does not append.
func (ListUint32) String ¶
func (l ListUint32) String() string
func (ListUint32) TagType ¶
func (ListUint32) TagType() TagID
TagType returns the TagID of the type of tag this list contains.
type ListUint64 ¶
type ListUint64 []Uint64
ListUint64 satisfies the List interface for a list of Uint64s.
func (*ListUint64) Append ¶
func (l *ListUint64) Append(d ...Data) error
Append adds data to the list
func (ListUint64) Copy ¶
func (l ListUint64) Copy() Data
Copy simply returns a deep-copy of the data.
func (ListUint64) Equal ¶
func (l ListUint64) Equal(e interface{}) bool
Equal satisfies the equaler.Equaler interface, allowing for types to be checked for equality
func (ListUint64) Get ¶
func (l ListUint64) Get(i int) Data
Get returns the data at the given position.
func (*ListUint64) Insert ¶
func (l *ListUint64) Insert(i int, d ...Data) error
Insert will add the given data at the specified position, moving other up.
func (*ListUint64) Remove ¶
func (l *ListUint64) Remove(i int)
Remove deletes the specified position and shifts remaining data down.
func (ListUint64) Set ¶
func (l ListUint64) Set(i int, d Data) error
Set sets the data at the given position. It does not append.
func (ListUint64) String ¶
func (l ListUint64) String() string
func (ListUint64) TagType ¶
func (ListUint64) TagType() TagID
TagType returns the TagID of the type of tag this list contains.
type ListUint8 ¶
type ListUint8 []Uint8
ListUint8 satisfies the List interface for a list of Uint8s.
func (ListUint8) Equal ¶
Equal satisfies the equaler.Equaler interface, allowing for types to be checked for equality
func (*ListUint8) Insert ¶
Insert will add the given data at the specified position, moving other up.
type Long ¶
type Long int64
Long is an implementation of the Data interface.
type Short ¶
type Short int16
Short is an implementation of the Data interface.
type String ¶
type String string
String is an implementation of the Data interface.
type Tag ¶
type Tag struct {
// contains filtered or unexported fields
}
Tag is the main NBT type, a combination of a name and a Data type.
func (Tag) Equal ¶
Equal satisfies the equaler.Equaler interface, allowing for types to be checked for equality.
type TagID ¶
type TagID uint8
TagID represents the type of nbt tag.
const ( TagEnd TagID = 0 TagByte TagID = 1 TagShort TagID = 2 TagInt TagID = 3 TagLong TagID = 4 TagFloat TagID = 5 TagDouble TagID = 6 TagByteArray TagID = 7 TagString TagID = 8 TagList TagID = 9 TagCompound TagID = 10 TagIntArray TagID = 11 TagBool TagID = 12 TagUint8 TagID = 13 TagUint16 TagID = 14 TagUint32 TagID = 15 TagUint64 TagID = 16 TagComplex64 TagID = 17 TagComplex128 TagID = 18 )
Tag Types
type Uint16 ¶
type Uint16 uint16
Uint16 is an implementation of the Data interface.
type Uint32 ¶
type Uint32 uint32
Uint32 is an implementation of the Data interface.
type Uint64 ¶
type Uint64 uint64
Uint64 is an implementation of the Data interface.
type Uint8 ¶
type Uint8 uint8
Uint8 is an implementation of the Data interface.
type UnknownTag ¶
type UnknownTag struct {
TagID
}
UnknownTag is an error that occurs when an unknown tag id is discovered. This could also indicate corrupted or non-compliant data.
func (UnknownTag) Error ¶
func (u UnknownTag) Error() string
type WriteError ¶
WriteError is an error returned when a write error occurs.
func (WriteError) Error ¶
func (w WriteError) Error() string