nbt

package
v0.0.0-...-f8d8a15 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2012 License: BSD-2-Clause Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DataStructNotFound = errors.New("'Data' struct not found")
	SpawnIntNotFound   = errors.New("SpawnX/SpawnY/SpawnZ int32s not found")
)
View Source
var (
	ErrListUnknown = errors.New("Lists of unknown type aren't supported")
)

Functions

func Explain

func Explain(r io.Reader, w io.Writer) error

func Parse

func Parse(r io.Reader) (map[string]interface{}, error)

Types

type Block

type Block uint16

type Chunk

type Chunk struct {
	XPos, ZPos int
	Blocks     []Block
}

func ReadChunkDat

func ReadChunkDat(reader io.Reader) (*Chunk, error)

func ReadChunkNbt

func ReadChunkNbt(reader io.Reader) (*Chunk, error)

type Level

type Level struct {
	SpawnX, SpawnY, SpawnZ int
}

func ReadLevelDat

func ReadLevelDat(reader io.Reader) (*Level, error)

func ReadLevelNbt

func ReadLevelNbt(reader io.Reader) (*Level, error)

type Reader

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

func NewReader

func NewReader(r io.Reader) *Reader

func (*Reader) ReadBytes

func (r *Reader) ReadBytes() ([]byte, error)

func (*Reader) ReadFloat32

func (r *Reader) ReadFloat32() (float32, error)

func (*Reader) ReadFloat64

func (r *Reader) ReadFloat64() (float64, error)

func (*Reader) ReadInt16

func (r *Reader) ReadInt16() (int, error)

func (*Reader) ReadInt32

func (r *Reader) ReadInt32() (int, error)

func (*Reader) ReadInt64

func (r *Reader) ReadInt64() (int, error)

func (*Reader) ReadInt8

func (r *Reader) ReadInt8() (int, error)

func (*Reader) ReadInts

func (r *Reader) ReadInts() ([]int, error)

func (*Reader) ReadListHeader

func (r *Reader) ReadListHeader() (itemTypeId TypeId, length int, err error)

func (*Reader) ReadString

func (r *Reader) ReadString() (string, error)

func (*Reader) ReadStruct

func (r *Reader) ReadStruct() (map[string]interface{}, error)

func (*Reader) ReadTag

func (r *Reader) ReadTag() (typeId TypeId, name string, err error)

func (*Reader) ReadValue

func (r *Reader) ReadValue(typeId TypeId) (interface{}, error)

type TypeId

type TypeId byte
const (
	TagStructEnd TypeId = 0  // No name. Single zero byte.
	TagInt8      TypeId = 1  // A single signed byte (8 bits)
	TagInt16     TypeId = 2  // A signed short (16 bits, big endian)
	TagInt32     TypeId = 3  // A signed int (32 bits, big endian)
	TagInt64     TypeId = 4  // A signed long (64 bits, big endian)
	TagFloat32   TypeId = 5  // A floating point value (32 bits, big endian, IEEE 754-2008, binary32)
	TagFloat64   TypeId = 6  // A floating point value (64 bits, big endian, IEEE 754-2008, binary64)
	TagByteArray TypeId = 7  // { TAG_Int length; An array of bytes of unspecified format. The length of this array is <length> bytes }
	TagString    TypeId = 8  // { TAG_Short length; An array of bytes defining a string in UTF-8 format. The length of this array is <length> bytes }
	TagList      TypeId = 9  // { TAG_Byte tagId; TAG_Int length; A sequential list of Tags (not Named Tags), of type <typeId>. The length of this array is <length> Tags. } Notes: All tags share the same type.
	TagStruct    TypeId = 10 // { A sequential list of Named Tags. This array keeps going until a TAG_End is found.; TAG_End end } Notes: If there's a nested TAG_Compound within this tag, that one will also have a TAG_End, so simply reading until the next TAG_End will not work. The names of the named tags have to be unique within each TAG_Compound The order of the tags is not guaranteed.
	TagIntArray  TypeId = 11 // { TAG_Int length; An array of ints. The length of this array is <length> ints }
)

Jump to

Keyboard shortcuts

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