nbt

package module
v1.0.8 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2023 License: MIT Imports: 10 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ByteArrayTag

type ByteArrayTag []int8

func (ByteArrayTag) ID

func (b ByteArrayTag) ID() uint8

func (ByteArrayTag) PushToWriter

func (b ByteArrayTag) PushToWriter(writer io.ByteWriter, endian Endian, includeTagID bool) error

func (ByteArrayTag) Size

func (b ByteArrayTag) Size(includeTagID bool) int

type ByteTag

type ByteTag int8

func (ByteTag) ID

func (b ByteTag) ID() uint8

func (ByteTag) PushToWriter

func (b ByteTag) PushToWriter(writer io.ByteWriter, endian Endian, includeTagID bool) error

func (ByteTag) Size

func (b ByteTag) Size(includeTagID bool) int

type CompoundTag added in v1.0.1

type CompoundTag map[string]Tag

func (CompoundTag) ID added in v1.0.1

func (c CompoundTag) ID() uint8

func (CompoundTag) PushToWriter added in v1.0.1

func (c CompoundTag) PushToWriter(writer io.ByteWriter, endian Endian, includeTagID bool) error

func (CompoundTag) Size added in v1.0.1

func (c CompoundTag) Size(includeTagID bool) int

type DoubleTag

type DoubleTag float64

func (DoubleTag) ID

func (d DoubleTag) ID() uint8

func (DoubleTag) PushToWriter

func (d DoubleTag) PushToWriter(writer io.ByteWriter, endian Endian, includeTagID bool) error

func (DoubleTag) Size

func (d DoubleTag) Size(includeTagID bool) int

type EndTag

type EndTag struct{}

func (EndTag) ID

func (e EndTag) ID() uint8

func (EndTag) PushToWriter

func (e EndTag) PushToWriter(writer io.ByteWriter, endian Endian, includeTagID bool) error

func (EndTag) Size

func (e EndTag) Size(includeTagID bool) int

type Endian

type Endian int
const (
	BigEndian Endian = iota
	LittleEndian
)

type FloatTag

type FloatTag float32

func (FloatTag) ID

func (f FloatTag) ID() uint8

func (FloatTag) PushToWriter

func (f FloatTag) PushToWriter(writer io.ByteWriter, endian Endian, includeTagID bool) error

func (FloatTag) Size

func (f FloatTag) Size(includeTagID bool) int

type IntArrayTag

type IntArrayTag []int32

func (IntArrayTag) ID

func (i IntArrayTag) ID() uint8

func (IntArrayTag) PushToWriter

func (i IntArrayTag) PushToWriter(writer io.ByteWriter, endian Endian, includeTagID bool) error

func (IntArrayTag) Size

func (i IntArrayTag) Size(includeTagID bool) int

type IntTag

type IntTag int32

func (IntTag) ID

func (i IntTag) ID() uint8

func (IntTag) PushToWriter

func (i IntTag) PushToWriter(writer io.ByteWriter, endian Endian, includeTagID bool) error

func (IntTag) Size

func (i IntTag) Size(includeTagID bool) int

type ListTag

type ListTag []Tag

func (ListTag) ID

func (l ListTag) ID() uint8

func (ListTag) PushToWriter

func (l ListTag) PushToWriter(writer io.ByteWriter, endian Endian, includeTagID bool) error

func (ListTag) Size

func (l ListTag) Size(includeTagID bool) int

type LongArrayTag

type LongArrayTag []int64

func (LongArrayTag) ID

func (l LongArrayTag) ID() uint8

func (LongArrayTag) PushToWriter

func (l LongArrayTag) PushToWriter(writer io.ByteWriter, endian Endian, includeTagID bool) error

func (LongArrayTag) Size

func (l LongArrayTag) Size(includeTagID bool) int

type LongTag

type LongTag int64

func (LongTag) ID

func (l LongTag) ID() uint8

func (LongTag) PushToWriter

func (l LongTag) PushToWriter(writer io.ByteWriter, endian Endian, includeTagID bool) error

func (LongTag) Size

func (l LongTag) Size(includeTagID bool) int

type NBT

type NBT struct {
	Name *string
	Tags CompoundTag // Please don't put NBT in NBT
}

NBT We use NBT to represent Compound

func NewNBT

func NewNBT(name string) *NBT

func NewNBTWithTags added in v1.0.8

func NewNBTWithTags(name string, tags CompoundTag) *NBT

func NewRootNBT added in v1.0.8

func NewRootNBT() *NBT

func NewRootNBTWithTags added in v1.0.8

func NewRootNBTWithTags(tags CompoundTag) *NBT

func ParseSNBT

func ParseSNBT(input string) (*NBT, error)

func ReadNBT added in v1.0.4

func ReadNBT(reader *bufio.Reader, endian Endian, includeRootName bool) (*NBT, error)

func (*NBT) FormatSNBT

func (n *NBT) FormatSNBT() (string, error)

func (*NBT) ID

func (n *NBT) ID() uint8

func (*NBT) PushToWriter

func (n *NBT) PushToWriter(writer io.ByteWriter, endian Endian, includeTagID bool) error

func (*NBT) Size

func (n *NBT) Size(includeTagID bool) int

type ShortTag

type ShortTag int16

func (ShortTag) ID

func (s ShortTag) ID() uint8

func (ShortTag) PushToWriter

func (s ShortTag) PushToWriter(writer io.ByteWriter, endian Endian, includeTagID bool) error

func (ShortTag) Size

func (s ShortTag) Size(includeTagID bool) int

type StringTag

type StringTag string

func (StringTag) ID

func (s StringTag) ID() uint8

func (StringTag) PushToWriter

func (s StringTag) PushToWriter(writer io.ByteWriter, endian Endian, includeTagID bool) error

func (StringTag) Size

func (s StringTag) Size(includeTagID bool) int

type Tag

type Tag interface {
	ID() uint8
	Size(includeTagID bool) int // Total size in bytes
	//TODO: String() string                                                            // Returns a string representation of the tag
	PushToWriter(writer io.ByteWriter, endian Endian, includeTagID bool) error // Pushes the tag to the writer
}

Jump to

Keyboard shortcuts

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