Documentation ¶
Index ¶
- Variables
- func Explain(r io.Reader, w io.Writer) error
- func Parse(r io.Reader) (map[string]interface{}, error)
- type Block
- type Chunk
- type Level
- type Reader
- func (r *Reader) ReadBytes() ([]byte, error)
- func (r *Reader) ReadFloat32() (float32, error)
- func (r *Reader) ReadFloat64() (float64, error)
- func (r *Reader) ReadInt16() (int, error)
- func (r *Reader) ReadInt32() (int, error)
- func (r *Reader) ReadInt64() (int, error)
- func (r *Reader) ReadInt8() (int, error)
- func (r *Reader) ReadInts() ([]int, error)
- func (r *Reader) ReadListHeader() (itemTypeId TypeId, length int, err error)
- func (r *Reader) ReadString() (string, error)
- func (r *Reader) ReadStruct() (map[string]interface{}, error)
- func (r *Reader) ReadTag() (typeId TypeId, name string, err error)
- func (r *Reader) ReadValue(typeId TypeId) (interface{}, error)
- type TypeId
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 ¶
Types ¶
type Reader ¶
type Reader struct {
// contains filtered or unexported fields
}
func (*Reader) ReadFloat32 ¶
func (*Reader) ReadFloat64 ¶
func (*Reader) ReadListHeader ¶
func (*Reader) ReadString ¶
func (*Reader) ReadStruct ¶
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 } )
Click to show internal directories.
Click to hide internal directories.